Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Distribute pdb files with Visual Studio prebuilt  (Read 4561 times)

0 Members and 1 Guest are viewing this topic.

blindley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Distribute pdb files with Visual Studio prebuilt
« on: February 08, 2015, 10:41:14 pm »
When you link to SFML statically, and build in debug mode, Visual Studio generates warning LNK4099(https://msdn.microsoft.com/en-us/library/b7whw3f3.aspx) for every object file in the libraries you link. I searched in the help forums to see what other people did about this, and the solution always seems to be "build the library yourself".

Is there any particular reason the pdb files can't just be distributed with the prebuilt versions of the library?

Alternatively (perhaps preferably), remove the /Zi option (https://msdn.microsoft.com/en-us/library/958x11bc.aspx) when building the libraries, in order to generate no debug info. Or change it to /Z7, in order to put the debug info in the object files themselves.
« Last Edit: February 08, 2015, 10:44:11 pm by blindley »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Distribute pdb files with Visual Studio prebuilt
« Reply #1 on: February 08, 2015, 11:22:47 pm »
You should also have searched for this request before posting.

http://en.sfml-dev.org/forums/index.php?topic=17410.0
Laurent Gomila - SFML developer

blindley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Distribute pdb files with Visual Studio prebuilt
« Reply #2 on: February 08, 2015, 11:41:46 pm »
Well, I did search for it. It's not in the feature request forums. I also searched other forums, but there were many results, and I did not read them all, I'm afraid. However, the ones I did read suggested, as I said, building the libraries yourself.

Okay, so your response at the end of that discussion is:

Quote
I see a very good reason for not including them: they would double (or even triple) the size of SDKs, for just a tiny amount of users very capable of building SFML themselves.

Perfectly understandable. So how about my other suggestion? Remove the /Zi flag when building. This will make the distributed libraries even smaller.

lamogui

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Distribute pdb files with Visual Studio prebuilt
« Reply #3 on: February 09, 2015, 06:59:42 pm »
From my point of view: only the optimized packages are necessary, debug packages are only usefull when you implement something into SFML... In that case your already compile SFML...
+ they are so much version of VS (2008 and 2012 are the only really usefull) and there isn't any fucking retrocompatibility since 2008.

blindley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Distribute pdb files with Visual Studio prebuilt
« Reply #4 on: February 09, 2015, 07:45:07 pm »
Well, actually, the Debug packages are useful if you want to debug your own code. Because depending upon whether you build in debug mode or release mode, different versions of the runtime library are used. Mixing runtime libraries is possible but not recommended, so if you want to build your own code in debug mode, it's best to use a version of SFML which was also built in debug mode.

However, like I've said, it's possible to build a library in debug mode (i.e. using the debug runtime libraries), but with no debug information for the library itself. Just remove the /Zi flag.
« Last Edit: February 09, 2015, 07:49:14 pm by blindley »

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Distribute pdb files with Visual Studio prebuilt
« Reply #5 on: February 09, 2015, 07:46:55 pm »
Debug builds of SFML are available. It's just the PDB files that are not. Not the same thing.

blindley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Distribute pdb files with Visual Studio prebuilt
« Reply #6 on: February 09, 2015, 07:57:09 pm »
Debug builds of SFML are available. It's just the PDB files that are not. Not the same thing.

Yes. I know. The problem is that when you build against those libraries, VS will complain about the missing PDB files. There is also no way to silence the warning (as far as I am aware), because it is on the list of warnings too important to ignore.

I freely admit, this is a minor problem, but a problem none the less. And the solution is fairly simple. At least it is simple from the IDE end. I'm not sure exactly what needs to be done for CMake to generate the correct build files in the first place. I'd be willing to investigate myself exactly how that can be done, if the Devs agree that it's something that should be fixed.