Jump to content
  • Advertisement
Sign in to follow this  
brasslips2

Linking with multiple .lib project in VS

This topic is 2857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, currently I have a setup where I have one .exe project and the rest are built as static libraries in my solution. Everything works great as long as i manually build the static libraries first and then build the .exe. I need all of the static libraries to build first so i setup the project dependencies so my executable was the last to be built. However, when I do a rebuild all it cleans my .lib files and then gives me a linker error LINK : fatal error LNK1104: cannot open file '.\libs\core.lib'. If I build the static libraries manually again by right clicking and building project only to all of my projects then it compiles and runs fine again. Is there a way to get the static libraries to make their .lib files before the executable runs so that I don't have to manually compile each project when doing a rebuild all? It would be great if I could hit rebuild all and everything worked in one button =)

Share this post


Link to post
Share on other sites
Advertisement
I figured out my issue. Further up in the output window I was getting LNK4204: '...' is missing debugging information for referencing module; linking object as if no debug info

I figured out this was caused because I have all of my .vcproj files in the same directory and all of them were writing to $(ConfiurationName) as their intermediate directory. This would have worked out splended if all of them weren't writing to vc90.pdb at the same time within $(ConfigurationName).

In order to fix it I changed the intermediate directory for my .vcproj files other than the one that creates the .exe. I did this by going into properties->ConfigurationProperties->General->Intermediate Directory and changed it to $(ConfigurationName)\$(ProjectName)

Now I can successfully do a Rebuild Solution that consistently works in one button press rather than right clicking on each project individually and building :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!