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.

DSPC
  • 350
  • 2
  • 12
  • 1
    This page on [LNK4204 Errror](https://msdn.microsoft.com/en-us/library/5ske5b71.aspx) should help. – Thomas Matthews May 28 '15 at 21:51
  • 1
    You can also open up the folder containing the "*.pdb" files and delete them. Visual Studio will recreate them. – Thomas Matthews May 28 '15 at 21:52
  • 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? – DSPC May 28 '15 at 22:14

2 Answers2

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.

DSPC
  • 350
  • 2
  • 12
  • 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. – TankorSmash Dec 08 '18 at 16:15
  • 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. – DSPC Dec 17 '18 at 08:28
0

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.

egrunin
  • 24,650
  • 8
  • 50
  • 93