Can't compile with UNICODE. No "+" operator for tstring

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
theonlylawislove
Posts: 34
Joined: Thu, 2014-07-17, 09:07

Can't compile with UNICODE. No "+" operator for tstring

#1 Post by theonlylawislove »

When compiling with Visual Studio 2013, I can't compile with unicode support. It works fine when compiling with multi-byte, instead of unicode.

Code: Select all

1>D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/oflog/tracelog.h(59): error C2679: binary '+' : no operator found which takes a right-hand operand of type 'dcmtk::log4cplus::tstring' (or there is no acceptable conversion)
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(895): could be 'OFString operator +(const OFString &,char)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(888): or       'OFString operator +(const OFString &,const char *)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(881): or       'OFString operator +(char,const OFString &)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(874): or       'OFString operator +(const char *,const OFString &)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(867): or       'OFString operator +(const OFString &,const OFString &)'
1>          while trying to match the argument list '(const wchar_t [8], dcmtk::log4cplus::tstring)'
1>D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/oflog/tracelog.h(59): error C2664: 'void dcmtk::log4cplus::Logger::forcedLog(const dcmtk::log4cplus::spi::InternalLoggingEvent &) const' : cannot convert argument 3 from 'int' to 'const char *'
1>          Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/oflog/tracelog.h(64): error C2679: binary '+' : no operator found which takes a right-hand operand of type 'dcmtk::log4cplus::tstring' (or there is no acceptable conversion)
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(895): could be 'OFString operator +(const OFString &,char)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(888): or       'OFString operator +(const OFString &,const char *)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(881): or       'OFString operator +(char,const OFString &)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(874): or       'OFString operator +(const char *,const OFString &)'
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/ofstd/ofstring.h(867): or       'OFString operator +(const OFString &,const OFString &)'
1>          while trying to match the argument list '(const wchar_t [8], dcmtk::log4cplus::tstring)'
1>D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/oflog/tracelog.h(64): error C2664: 'void dcmtk::log4cplus::Logger::forcedLog(const dcmtk::log4cplus::spi::InternalLoggingEvent &) const' : cannot convert argument 3 from 'int' to 'const char *'
1>          Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/oflog/logmacro.h(106): error C2665: 'dcmtk::log4cplus::Logger::getInstance' : none of the 2 overloads could convert all the argument types
1>          D:\Git\MedXBroker\src\Dependencies\dcmtk\include\dcmtk/oflog/logger.h(112): could be 'dcmtk::log4cplus::Logger dcmtk::log4cplus::Logger::getInstance(const dcmtk::log4cplus::tstring &)'
1>          while trying to match the argument list '(const dcmtk::log4cplus::tchar *)'

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Can't compile with UNICODE. No "+" operator for tstring

#2 Post by J. Riesmeier »

The following excerpt is from the INSTALL (Windows section) file:

Code: Select all

5. DCMTK does not compile when UNICODE or _UNICODE is defined because the
   VisualStudio compiler then uses the Unicode version instead of the ANSI
   version for all Windows API functions (i.e. type wchar_t instead of char
   for all character string parameters and return values).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest