Cams
Cams

Reputation: 43

VS2010 fails on linking a lib that it's supposed to build

I'm having troubles with VS2010 when trying to build my DLL project. The DLL in itself is pretty well generated, but the .lib file I need to link with other dependant projects fails.

I have a classic __declspec(dllexport) and everything, don't worry about that, the build works perfectly in debug mode. I only have this issue in Release mode, but I don't hink I messed up with my settings (they're almost default).

Here's the output error I get (unresolved extern symbol) :

Erreur  274 error LNK1120: 1 externes non résolus   \Release\Engine.lib Engine
Erreur  273 error LNK2001: symbole externe non résolu App   LINK    Engine

For sure Visual Studio can't find this file: It's supposed to generate it!

I thought I had found a solution in Dll project doesn't build as Linker not able to find the same named .lib file (same problem) but I didn't understand how the answer was solving anything.

Has anyone ever had this issue and found a way to avoid it?

Upvotes: 4

Views: 1089

Answers (1)

ash
ash

Reputation: 3474

the build works perfectly in debug mode. I only have this issue in Release mode

Open up your .vcxproj file and check that your dependencies are consistent between debug and release builds, e.g., external libraries, additional include paths, etc. When this happens to me it's usually because I added something my debug configuration and forgot to make a similar change for release.

Upvotes: 6

Related Questions