我在 Visual Studio 2013 下使用 DCMTK 库。如果我在项目的属性中设置
Character Set: Use Unicode Character Set
编译时出现错误
Error 1 error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const wchar_t [8]' (or there is no acceptable conversion) C:\DCMTK\include\dcmtk\oflog\tracelog.h
Error 2 error C2664: 'void dcmtk::log4cplus::Logger::forcedLog(const dcmtk::log4cplus::spi::InternalLoggingEvent &) const' : cannot convert argument 3 from 'int' to 'const char *' C:\DCMTK\include\dcmtk\oflog\tracelog.h
Error 3 error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const wchar_t [8]' (or there is no acceptable conversion) C:\DCMTK\include\dcmtk\oflog\tracelog.h
Error 4 error C2664: 'void dcmtk::log4cplus::Logger::forcedLog(const dcmtk::log4cplus::spi::InternalLoggingEvent &) const' : cannot convert argument 3 from 'int' to 'const char *' C:\DCMTK\include\dcmtk\oflog\tracelog.h
Error 5 error C2665: 'dcmtk::log4cplus::Logger::getInstance' : none of the 2 overloads could convert all the argument types C:\DCMTK\include\dcmtk\oflog\logmacro.h
IntelliSense: no instance of overloaded function "dcmtk::log4cplus::Logger::getInstance" matches the argument list
argument types are: (const dcmtk::log4cplus::tchar *) c:\DCMTK\include\dcmtk\oflog\logmacro.h
IntelliSense: no operator "+" matches these operands
operand types are: const wchar_t [8] + dcmtk::log4cplus::tstring c:\DCMTK\include\dcmtk\oflog\tracelog.h
IntelliSense: no operator "+" matches these operands
operand types are: const wchar_t [8] + dcmtk::log4cplus::tstring c:\DCMTK\include\dcmtk\oflog\tracelog.h
IntelliSense: identifier "cerr" is undefined c:\Users\Kyle\Google Drive\cpp_codes\dicom\DicomTest\test1\Source.cpp
IntelliSense: identifier "endl" is undefined c:\Users\Kyle\Google Drive\cpp_codes\dicom\DicomTest\test1\Source.cpp
如果我设置我可以解决Character Set: Use Multi-Byte Character Set
但我需要在字符集必须为 Unicode 的另一个项目中使用 DCMTK。查看错误,问题仅存在于关于日志的某些类中,可能我永远不会使用:所以我尝试注释出现错误的代码行,现在我可以使用 Unicode 进行编译。
这是解决问题的独特方法吗?我可以评论那部分有什么问题?