DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Thu, 2018-04-26, 21:54

All times are UTC + 1 hour




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri, 2016-02-19, 20:37 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
Quote:
Tried snapshot with VS15 and building the example you provided received many errors like:

Seems like you are mixing libraries with different settings for "code generation". If you don't understand what this means, you should probably learn more about your compiler/linker before you start programming. I'm sorry but these are the basics, which are not DCMTK-specific.

Quote:
Also, compiling dcmtk libraries received multiple warnings.

I also installed VS 2015 a couple of days ago (my main platform for development is Linux with gcc). Most (if not all) of the warning are non-critical. We'll get rid of them for the next release.


Top
 Profile  
 
PostPosted: Fri, 2016-02-19, 21:26 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
Should be easy to find but... the linker error is described here: https://msdn.microsoft.com/en-us/en-en/ ... 89284.aspx

Quote:
RuntimeLibrary
Indicates the version of the C++ Standard Library and C runtime that's used by an app or library.
Code that uses one version of the C++ Standard Library or C runtime is incompatible with code that uses a different version.
For more information, see /MD, /MT, /LD (Use Run-Time Library).


Top
 Profile  
 
PostPosted: Sat, 2016-02-20, 11:19 
Offline

Joined: Fri, 2016-02-19, 08:51
Posts: 20
Now I have tried to build the latest snapshot version with Visual Studio Express 2013 for Desktop and got the following warning:

Quote:
strcloc.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library


Is it an important warning which could cause the later failure of using the libraries?


Top
 Profile  
 
PostPosted: Sat, 2016-02-20, 11:29 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
No, as I said the warnings are non-critical (even for VS 2013). Warnings are warnings but no errors. The cited warning just means that the "strcloc.obj" file does not define any symbols (global variables or functions/methods) that are not defined anywhere else. DCMTK is a portable toolkit so it does not only support Windows but also Linux, Mac OS X, FreeBSD, OpenBSD, etc. Some compilers moan about things like that and others do not...

We try to get rid of all warnings for a release (using the supported compilers with default settings) but not necessarily for each and every snapshot (which would not be feasible for the long list of supported platforms (operating systems and compilers)).

Your problem is not compiling (and linking) the DCMTK but linking it with your own program - see my above postings.


Top
 Profile  
 
PostPosted: Sat, 2016-02-20, 12:02 
Offline

Joined: Fri, 2016-02-19, 08:51
Posts: 20
Thank you for your kind help J. Riesmeier. Finally I made it work with VS2013. I needed to change my testapp Runtime Library option from Multi-threaded Debug DLL (/MDd) to Multi-threaded Debug (/MTd) in Property Pages. Actually, I don't really understand what is the difference :D Now I have the problem with launching it in Qt creator...


Top
 Profile  
 
PostPosted: Sat, 2016-02-20, 12:42 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
Good to hear that you are on the right track :)

Of course, you can also compile the DCMTK with "Multi-threaded Debug DLL (/MDd)". For doing so, just disable the CMake option DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS and recompile... this will let CMake decided what's "best" for your system.


Top
 Profile  
 
PostPosted: Sat, 2016-02-20, 13:05 
Offline

Joined: Fri, 2016-02-19, 08:51
Posts: 20
Now I have tried with Qt creator and I get the following error:

Quote:
C:\DCMTK\include\dcmtk\ofstd\offile.h:397: error: cannot convert 'bool' to 'FILE* {aka _iobuf*}' in assignment
file_ = _popen(command, modes);


If I open the file offile.h and change line file_ = _popen(command, modes) to file_ = ::popen(command, modes) I do not get this error anymore but then I get the undefined reference error as I mentioned at the begining. Is it OK to change the file like this or there is another problem behind it?


Top
 Profile  
 
PostPosted: Sat, 2016-02-20, 19:49 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1928
Location: Oldenburg, Germany
Of course, it is not "OK" (i.e. not the right way) to change the source code. Whether _popen() or ::popen() is used, this is determined during the configuration step (DCMTK's CMake or Autoconf process). Therefore, it is important that DCMTK's "osconfig.h" header file is included first in each and every DCMTK source/header file.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users 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