# Linking with multiple .lib project in VS

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

## 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 on other sites
Have you try setting up build order?

##### Share on other sites
Yes I have the build order set up

##### Share on other sites
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 :)

1. 1
2. 2
3. 3
Rutin
20
4. 4
khawk
14
5. 5

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633655
• Total Posts
3013186
×