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

2

6

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.

Busch answered 28/5, 2015 at 21:44 Comment(3)
This page on LNK4204 Errror should help.Forthcoming
You can also open up the folder containing the "*.pdb" files and delete them. Visual Studio will recreate them.Forthcoming
The point is that there's nothing wrong with the pdb files, they are all there. I think they might be in the wrong place but I have no idea where to put them. And that page doesn't make that much sense to me either. Do I really need to rebuild SFML with different linker settings to simply not get a wall of warnings in a different project?Busch
B
10

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.

Busch answered 29/5, 2015 at 11:16 Comment(2)
What is the impact of this? Does it mean you can't debug properly or anything? Seems like it just makes it tougher to remove the debug symbols from the final release. There is probably a better way to solve the issue, but I'm not sure what it would be.Procne
I do not remember exactly. I was using SFML for games, so my goal was basically just to get the executable to run. From what I know, this is definitely not the ideal solution.Busch
F
1

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.

Foreandafter answered 11/5, 2022 at 23:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.