error C2678: binary '+': no operator found (DCMTK 3.6.4 & VS2017_x64)

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
eninyo
Posts: 9
Joined: Tue, 2019-05-07, 07:27

error C2678: binary '+': no operator found (DCMTK 3.6.4 & VS2017_x64)

#1 Post by eninyo » Tue, 2019-05-07, 08:25

hello,
i download DCMTK version 3.6.4. run CMake and compile it with VS2017 64bit.
i didn't set any special flag.

while i'm compiling my application, i get the following error in a file thaat is not mine and i'm not using.

Code: Select all

...\include\dcmtk\oflog\tracelog.h:59: error: C2678: binary '+': no operator found which takes a left-hand operand of type 'const wchar_t [8]' (or there is no acceptable conversion)
i don't use UNICODE. the INSTALL VS project has "Use Multi-Byte Character Set".

so i don't understand what i can do?
is it a known bug in v3.6.4?

thanks in advance,

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: error C2678: binary '+': no operator found (DCMTK 3.6.4 & VS2017_x64)

#2 Post by Jan Schlamelcher » Wed, 2019-05-08, 09:48

No, we don't know about that and VS 2017 works well in our Nightlybuilds. I, therefore, consider it more likely that it is either a configuration problem or a problem with your VS setup (e.g. wrong platform SDK installed). The error in line 59 suggests that log4cplus::tstring got defined as std::wstring while it should be std::string, no clue what step in your configuration had that effect though.

eninyo
Posts: 9
Joined: Tue, 2019-05-07, 07:27

Re: error C2678: binary '+': no operator found (DCMTK 3.6.4 & VS2017_x64)

#3 Post by eninyo » Sun, 2019-05-12, 08:28

hi,
the problem is not when compiling the DCMTK library.
it happens when i compile my application that use (link) to the DCMTK.
my solution was manually write #undef UNICODE above the problematic line, but i want to know if there is a more supportive way to do it without changing the code of DCMTK.

thanks in advance,
Eliah

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

Re: error C2678: binary '+': no operator found (DCMTK 3.6.4 & VS2017_x64)

#4 Post by J. Riesmeier » Sun, 2019-05-12, 18:55

The solution would be to adapt your project settings so that neither UNICODE nor _UNICODE is defined.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest