I am trying to use a 2005 era library with MSVC 2013 but I am getting unresolved externals errors in Release Mode

StackOverflow https://stackoverflow.com/questions/21418986

سؤال

The setup: I have successfully compiled DarkGDK, a library designed for use with DirectX SDK 2007 and VS 2008, in VS 2013 with DirectX SDK 2010. I replaced one of the component libraries with a custom dummy library to resolve DirectX conflicts. I was able to successfully compile all of these component libraries.

The Problem: When I compile my project that makes use of the DarkGDK libraries in Release mode, everything works as expected. I do get an message box complaining that the binary was built without debug information, but my program runs. However, in Debug mode, I get a number of errors. Below find a sample that I believe represents the lot well:

1>convmdl.lib(ConvMDL.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl QuaternionSlerp(float const * const,float * const,float,float * const)" (?QuaternionSlerp@@YAXQBMQAMM1@Z)
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>system.lib(CSystemC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>system.lib(dxdiaginfo.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>convx.lib(ConvX.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>convmd3.lib(ConvMD3.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CBSPTree.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CCompiler.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(ProcessHSR.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>world.lib(Patch.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(Universe.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(cLightMaps.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CSG.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(NVMeshMenderD3DX.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>image.lib(CImageC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>animation.lib(CAnimation.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(DBOFormat.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CObjectManagerC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>core.lib(RenderList.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>display.lib(CGfxC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>file.lib(CFileC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>sprites.lib(CSpriteManagerC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>Debug\Weapon Creator 2 - Project Golden Girl.exe : fatal error LNK1120: 1 unresolved externals

I have been searching about this issue for a few days now. I have have checked all the projects' settings that belong to the DarkGDK library and my own project's settings. In Debug configuration they are all using "Multi-threaded Debug (/MTd)".

TL;DR I am getting the above errors when attempting to compile a project in Debug configuration that uses the DarkGDK Library. All projects have the same Windows Library and C run time settings.

Thank you!

Edit: Errors changed to reflect Dauphic's contribution.

هل كانت مفيدة؟

المحلول

You're mixing debug and release runtimes.

__CrtDbgReportW only exists in the debug runtime. If it's unresolved, it means you're probably compiling using the release runtime, but one of your libraries is using the debug runtime. You have to recompile one or the other, so they both use the same version.

You can find the runtime property at Project Properties -> C/C++ -> Code Generation -> Runtime Library

For the unresolved ATL symbol, I believe you need to link atls.lib.

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