warning LNK4204 with DCMTK

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
GiordiX
Posts: 27
Joined: Fri, 2015-01-23, 15:36

warning LNK4204 with DCMTK

#1 Post by GiordiX »

Hi,
I have added the DCMTK library inside another project. I'm using Visual Studio 2013 and the code works properly but when I compile it I have about 700 warnings, all like this:

Code: Select all

dcmdata.lib(dcbytstr.obj): warning LNK4204: 'path\vc120.pdb' is missing debugging information for referencing module; linking object as if no debug info
etc etc etc for each dcmtk file

I have read a lot of thing about this warning but I think that in my case I can ignore it. I have tried a lot of thing in order to remove it but nothing happens. Looking at the dcmtk\config\osconfig.h I have found this portion of the code

Code: Select all

#if _MSC_VER >= 1400                   /* Additional settings for Visual Studio 2005 and newer */
    #pragma warning( disable : 4996 )  /* disable warnings about "deprecated" C runtime functions */
    #pragma warning( disable : 4351 )  /* disable warnings about "new behavior" when initializing the elements of an array */
#endif /* _MSC_VER >= 1400 */
So I have tried to add #pragma warning( disable : 4204 ) but doesn't work.

Another strange things is that I don't have the warnings if I don't delete the directory where I have extracted the DCMTK library and used with CMAKE. What I mean is that if I extract in C:\test and use the CMAKE using as source C:\test I don't have the warnings but if I delete or rename teh C:\test the warning appears; so I think that in some place there is this absolute path.

How can I fix it o how I can supress the warning?

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

Re: warning LNK4204 with DCMTK

#2 Post by J. Riesmeier »

So the linker warns you that you are linking a library (DCMTK) without debug information to your program (which is compiled in debug mode), right?
This doesn't seem to be a DCMTK-related question but needs to be looked up in the documentation of your compiler/linker, e.g. here: https://msdn.microsoft.com/de-de/library/5ske5b71.aspx

As a general note: it's usually a bad idea to disable compiler/linker warnings. The above cited examples from the DCMTK package are rare exceptions.

GiordiX
Posts: 27
Joined: Fri, 2015-01-23, 15:36

Re: warning LNK4204 with DCMTK

#3 Post by GiordiX »

J. Riesmeier wrote:So the linker warns you that you are linking a library (DCMTK) without debug information to your program (which is compiled in debug mode), right?
This doesn't seem to be a DCMTK-related question but needs to be looked up in the documentation of your compiler/linker, e.g. here: https://msdn.microsoft.com/de-de/library/5ske5b71.aspx

As a general note: it's usually a bad idea to disable compiler/linker warnings. The above cited examples from the DCMTK package are rare exceptions.
Yes this is the problem, here in english: https://msdn.microsoft.com/en-us/library/5ske5b71.aspx I can't use the /Z7 flag in my application and when I have compiled the DCMTK library I don't have any pdb file to add to my project.

I think it's a DCMTK-related question because if I don't delete the main folder that I have used with CMake to generate the library, I don't have any warning; isn't it?

EDIT: Starting from the DMCTK solution, How I can create the xyz.lib files in such a way they look for the vc120.pdb file in a relative directory? (The same where the header file are stored)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest