简体   繁体   中英

How do I fix LNK4204, or get rid of it?

I'm statically linking SFML2.3 into my application. When linking in debug mode, I get a huge wall of warnings, all of them like this:

1>sfml-graphics-s-d.lib(View.obj) : warning LNK4204: 'D:\DATA\Libraries\Programming\SFML Projects\SimpleAdventure\Debug\vc120.pdb' is missing debugging information for referencing module; linking object as if no debug info

But for different objects in different modules of SFML.

I compiled SFML, in the lib/debug folder there are pdb's for each of the libs. I tried copying them to my project's outputpath too, but the result is the same. I can't find any information on how to properly handle this. I don't want to compile my project without debug info, as was suggested somewhere, but I don't care about these libs.

Turning the warning off with /ignore:4204 does not work either because it's on some list of not ignorable warnings for some reason.

Any insight would be appreciated!

EDIT I ended up recompiling all libraries metioned by the warnings with Z7, as to embed the debug info in the libs themselves. This removed all warnings. But I still do not understand why separate pdb's were an issue all of a sudden.

I ended up recompiling all libraries metioned by the warnings with Z7 (Properties -> C/C++ -> Debug Information Format), as to embed the debug info in the libs themselves. This removed all warnings.

I needed to compile with /Zi, but when I did so I kept getting those warnings. What worked for me just now:

Change the flags to /Z7
Rebuild
Change the flags back to /Zi
Rebuild

Next link I had no more warnings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM