Visual C++ 2005 Linking error
by Jeff Armstrong · in Torque Game Engine Advanced · 12/29/2005 (6:28 pm) · 4 replies
Hi everyone. I keep running into a linking error when I try to build TSE using Visual C++ 2005 Express. My DirectX SDK is installed correctly and the include and lib paths have been set correctly. I've also installed the Platform SDK correctly. The linking error seems to be coming from a missing library related to DXDiag. There is a sample project that ships with DirectX call DxDiagOutput that generates the exact same linking errors. I can't figure out which DirectX library is missing from the linking process. Has anyone else encountered this problem? I've included a screen dump of the linking errors at the bottom of this email. The formatting is kind of ugly, sorry. Thanks for you help.
-Jeff
1>------ Build started: Project: Torque Shader Engine, Configuration: Debug Win32 ------
1>Linking...
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__VariantClear@4 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::GetProperty(struct NVDXDiagWrapper::IDxDiagContainer *,wchar_t const *,class std::basic_string,class std::allocator > *)" (?GetProperty@DXDiagNVUtil@NVDXDiagWrapper@@QAEJPAUIDxDiagContainer@2@PB_WPAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__VariantInit@4 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::GetProperty(struct NVDXDiagWrapper::IDxDiagContainer *,wchar_t const *,class std::basic_string,class std::allocator > *)" (?GetProperty@DXDiagNVUtil@NVDXDiagWrapper@@QAEJPAUIDxDiagContainer@2@PB_WPAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__CoCreateInstance@20 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::InitIDxDiagContainer(void)" (?InitIDxDiagContainer@DXDiagNVUtil@NVDXDiagWrapper@@QAEJXZ)
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::InitIDxDiagContainer(void)" (?InitIDxDiagContainer@DXDiagNVUtil@NVDXDiagWrapper@@QAEJXZ)
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::FreeIDxDiagContainer(void)" (?FreeIDxDiagContainer@DXDiagNVUtil@NVDXDiagWrapper@@QAEJXZ)
1>../example/TSE_DEBUG.exe : fatal error LNK1120: 5 unresolved externals
1>Build log was saved at "file://c:\tse\engine\out.vc7.win32.debug\BuildLog.htm"
1>Torque Shader Engine - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========
-Jeff
1>------ Build started: Project: Torque Shader Engine, Configuration: Debug Win32 ------
1>Linking...
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__VariantClear@4 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::GetProperty(struct NVDXDiagWrapper::IDxDiagContainer *,wchar_t const *,class std::basic_string
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__VariantInit@4 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::GetProperty(struct NVDXDiagWrapper::IDxDiagContainer *,wchar_t const *,class std::basic_string
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__CoCreateInstance@20 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::InitIDxDiagContainer(void)" (?InitIDxDiagContainer@DXDiagNVUtil@NVDXDiagWrapper@@QAEJXZ)
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::InitIDxDiagContainer(void)" (?InitIDxDiagContainer@DXDiagNVUtil@NVDXDiagWrapper@@QAEJXZ)
1>DXDiagNVUtil.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "public: long __thiscall NVDXDiagWrapper::DXDiagNVUtil::FreeIDxDiagContainer(void)" (?FreeIDxDiagContainer@DXDiagNVUtil@NVDXDiagWrapper@@QAEJXZ)
1>../example/TSE_DEBUG.exe : fatal error LNK1120: 5 unresolved externals
1>Build log was saved at "file://c:\tse\engine\out.vc7.win32.debug\BuildLog.htm"
1>Torque Shader Engine - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========
#2
12/31/2005 (10:28 pm)
Thanks for following up and describing the fix to the problem so clearly! :)
#3
Heres a link incase anyone stumbles across this, as it'll save them some time (for tse owners only ofc sorry).
Compiling TSE with VS 2005 Express Edition
01/01/2006 (11:57 am)
Strange that you couldn't find anything, there is a pretty good thread thats very near the top in the "Getting Started" section of the TSE private forums (this should probably be in the private forums).Heres a link incase anyone stumbles across this, as it'll save them some time (for tse owners only ofc sorry).
Compiling TSE with VS 2005 Express Edition
#4
05/01/2006 (9:17 am)
I also thank you for posting it so clearly.
Torque Owner Jeff Armstrong
1. In the Torque Shader Engine project properties, under (C/C++ -> Code Generation), I had to change "Runtime Library" to "Multi-thread Debug". This was mentioned somewhere else on the forum.
2. In the Torque Shader Engine project properties, under (Linker -> Input), I had to set "Ignore Specific Library" to ignore "LIBCMT". This isn't required, but it helps avoid an anoying linker warning.
3. In the Torque Shader Engine project properties, I also had to add the following libraries to (project->linker->Input->Additional Dependencies):
oleaut32.lib
ole32.lib
This last part solved the problem I was posting about. Anyway, everyone else seemed to have things working fine, so it must have been something I was doing. After searching the forum, I couldn't find this last part. Hope it helps someone.
-Jeff