سؤال

I was building a win32 static library project and on debug mode it compiles without any problem but when I changed the build mode to release I get this link errors. Can anyone suggest what is going wrong here?

Error   2   error LNK1120: 1 unresolved externals   C:\Users\serak\Desktop\Cimg Wrapper\Release\nativeWin32console.exe  nativeWin32console
Error   1   error LNK2001: unresolved external symbol _main C:\Users\serak\Desktop\Cimg Wrapper\nativeWin32console\MSVCRT.lib(crtexe.obj)   nativeWin32console
هل كانت مفيدة؟

المحلول

I think in the Project Propierty Pages (rigth click the project in VS solution explorer) of the project change for ALL configuration and platform, the Configuration Propiertie->Project Defaults->Configuration Type-> from Aplication to Static Libraries: you probably have set it for debug but not for the release configuration.

نصائح أخرى

If you're using Visual Studio, you need to add any external libs that you are linking against in release mode as well. Chances are you have already done this for the debug build configuration, but it does not transfer to release by itself.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top