DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2017-12-18, 21:04

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Sat, 2017-11-18, 15:29 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
Hello everyone,

After successfully compile and install DCMTK, some error appeared, most of them are related to setup path of DCMTK.
But, some others still persist.

My environment :
- Microsoft Visual studio community 2015 / version 14.0.25123.00 Update2
- Windows 7 Professional 64 bits
- Qt 5.6.3
- dcmtk-3.6.2
- Cmake-3.9.4-win64-x64
- dcmtk-3.6.2-win64-support_MD-msvc-14.0

Those some screenshot of compile and installation steps :


build
https://prntscr.com/hc2j6u

http://prntscr.com/hc2on8

http://prntscr.com/hc2pj3

installation
http://prntscr.com/hc2pqm

Now, I include DCMTK to my project, on visual studio. ( in the begin it was a problem with include c:\DCMTK to "include directories " setting, it was fixed later.

http://prntscr.com/hc2qyz

Now, clean and rebuild my project, some error still appeared, but this time, are related to instruction in header files :

Code:
Severity   Code   Description   File   Line   Suppression State
Error (active)      expected an identifier   c:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error (active)      no instance of overloaded function "dcmtk::log4cplus::Logger::getInstance" matches the argument list   c:\DCMTK\include\dcmtk\oflog\logmacro.h   106   
Error (active)      no operator "+" matches these operands   c:\DCMTK\include\dcmtk\oflog\tracelog.h   59   
Error (active)      no operator "+" matches these operands   c:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error (active)      expected an identifier   c:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   
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   59   
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   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)   C:\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 *'   C:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error   C2665   'dcmtk::log4cplus::Logger::getInstance': none of the 2 overloads could convert all the argument types   C:\DCMTK\include\dcmtk\oflog\logmacro.h   106   
Error   C2589   '(': illegal token on right side of '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error   C2059   syntax error: '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error   C2589   '(': illegal token on right side of '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   
Error   C2059   syntax error: '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   
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   59   
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   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)   C:\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 *'   C:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error   C2665   'dcmtk::log4cplus::Logger::getInstance': none of the 2 overloads could convert all the argument types   C:\DCMTK\include\dcmtk\oflog\logmacro.h   106   
Error   C2589   '(': illegal token on right side of '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error   C2059   syntax error: '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error   C2589   '(': illegal token on right side of '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   
Error   C2059   syntax error: '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   
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   59   
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   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)   C:\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 *'   C:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error   C2665   'dcmtk::log4cplus::Logger::getInstance': none of the 2 overloads could convert all the argument types   C:\DCMTK\include\dcmtk\oflog\logmacro.h   106   
Error   C2589   '(': illegal token on right side of '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error   C2059   syntax error: '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   72   
Error   C2589   '(': illegal token on right side of '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   
Error   C2059   syntax error: '::'   C:\DCMTK\include\dcmtk\ofstd\oflimits.h   78   


For example :

tracelog.h
Severity Code Description File Line Suppression State
Error (active) expected an identifier c:\DCMTK\include\dcmtk\ofstd\oflimits.h 72

this is my suggestion
http://prntscr.com/hc2xvt
http://prntscr.com/hc2zoa

but others errors, I can't fix ?

Please, could you check this issues.

Thanks again to Offis team for all support and availability.


Top
 Profile  
 
PostPosted: Sat, 2017-11-18, 17:41 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
Regarding "oflimits.h", you should consider the following patch: http://git.dcmtk.org/?p=dcmtk.git;a=com ... 2b741dc01b

Regarding the other issue(s): are you compiling with UNICODE or _UNICODE defined?


Top
 Profile  
 
PostPosted: Sun, 2017-11-19, 02:00 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
Hi

Thank you for your fast reply.

In fact, after posting this topic, I re-compile and install DCMTK 3.2.6, I repeated all steps, just to ensure that everything is in a good way.

next, I change the new DMTK folder, in my vs2015 project, re-build, and install
now, it seems that problem-related to "oflimits.h", gone, even when I checked this file, I can't find those change, anyway, I applied the patch :)

so, the rest of issues still appeared, comes from "tracelog.h" and "logmacros.h"

I compile with UNICODE

http://prntscr.com/hcact0



Code:
http://prntscr.com/hca57l


Code:
Severity   Code   Description   File   Line   Suppression State
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   59   
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   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)   C:\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 *'   C:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error   C2665   'dcmtk::log4cplus::Logger::getInstance': none of the 2 overloads could convert all the argument types   C:\DCMTK\include\dcmtk\oflog\logmacro.h   106   
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   59   
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   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)   C:\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 *'   C:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error   C2665   'dcmtk::log4cplus::Logger::getInstance': none of the 2 overloads could convert all the argument types   C:\DCMTK\include\dcmtk\oflog\logmacro.h   106   
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   59   
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   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)   C:\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 *'   C:\DCMTK\include\dcmtk\oflog\tracelog.h   64   
Error   C2665   'dcmtk::log4cplus::Logger::getInstance': none of the 2 overloads could convert all the argument types   C:\DCMTK\include\dcmtk\oflog\logmacro.h   106   


Thank you


Top
 Profile  
 
PostPosted: Sun, 2017-11-19, 10:13 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
As you can read in the INSTALL file, compiling with UNICODE defined is not supported (in fact, it never was):
Quote:
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).


Top
 Profile  
 
PostPosted: Sun, 2017-11-19, 18:41 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
Hi

Thank you for your reply.

J. Riesmeier wrote:
As you can read in the INSTALL file, compiling with UNICODE defined is not supported (in fact, it never was):

So, what do you suggest in this case ?


Top
 Profile  
 
PostPosted: Sun, 2017-11-19, 18:47 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
Make sure that the macro UNICODE or _UNICODE is not defined when including a DCMTK header file.


Top
 Profile  
 
PostPosted: Sun, 2017-11-19, 19:03 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
yes, I verified, but always the same files from come error :
tracelog.h and logmacro.h


Top
 Profile  
 
PostPosted: Sun, 2017-11-19, 19:14 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
J. Riesmeier wrote:
Make sure that the macro UNICODE or _UNICODE is not defined when including a DCMTK header file.


MED_G wrote:
yes, I verified, but always the same files from come error :
tracelog.h and logmacro.h


Please check this :

http://prntscr.com/hcimxw

http://prntscr.com/hcio5j


Top
 Profile  
 
PostPosted: Mon, 2017-11-20, 10:10 
Offline

Joined: Tue, 2017-10-10, 09:44
Posts: 8
Make sure that project properties->general->character set is set as "Use Multi-Byte Character Set" and not "Use Unicode Character Set"
Hope that helps


Top
 Profile  
 
PostPosted: Mon, 2017-11-20, 11:12 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
Hi Hafiz,

Hafiz Rafeeq wrote:
Make sure that project properties->general->character set is set as "Use Multi-Byte Character Set" and not "Use Unicode Character Set"
Hope that helps


Thank you so much for your help.
I found it as " Not Set"

I checked that with my project, and re-build, but always some errors.

Maybe, I must compile and install DCMTK with your setting?
or just create the project again.

Anyway, I appreciate your time :)


Top
 Profile  
 
PostPosted: Tue, 2017-11-21, 12:40 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
Hello everyone,


I tried with both Visual Studio 2015 and 2017.

Cmake, ALL_BUILD and INSTALL, done without any problem.

Also, I set the parameter as Hafiz said :
Hafiz Rafeeq wrote:
Make sure that project properties->general->character set is set as "Use Multi-Byte Character Set" and not "Use Unicode Character Set"
Hope that helps

and
J. Riesmeier wrote:
Regarding "oflimits.h", you should consider the following patch: http://git.dcmtk.org/?p=dcmtk.git;a=com ... 2b741dc01b

Regarding the other issue(s): are you compiling with UNICODE or _UNICODE defined?


Always the same header files from errors come from "tracelog.h" and "logmacros.h"

Any suggestion!

Thank you


Top
 Profile  
 
PostPosted: Tue, 2017-11-21, 14:44 
Offline

Joined: Fri, 2017-11-17, 09:06
Posts: 14
Hi,


Example :

there is an error in this function
macros_get_logger (tchar const * logger)
{
return Logger::getInstance (logger);
}

but if I change

#if defined (UNICODE)
typedef wchar_t tchar;
#else

by this update, the error disappeared

#if defined (UNICODE)
typedef char tchar;
#else

even, I switched character set to " Use Multi-byte Character Set ".



Thank you


Top
 Profile  
 
PostPosted: Tue, 2017-11-28, 17:22 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1882
Location: Oldenburg, Germany
You could also disable the macro definition (temporarily) when including DCMTK header files:

Code:
#pragma push_macro("_UNICODE")
#undef _UNICODE

#include "dcmtk/dcmdata/dctk.h"

#pragma pop_macro("_UNICODE")


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group