When you build a new DirectX9 or DirectX10 project using Visual Studio2005 or higher verion, you may meet a strange error :
1>DXUTCORE_D_64.lib(DXUT.obj) : error LNK2019: unresolved external symbol __imp_InitCommonControls referenced in function "long __cdecl DXUTInit(bool,bool,wchar_t *,bool)" (?DXUTInit@@YAJ_N0PEA_W0@Z)
1>DXUTCORE_D_64.lib(DXUTmisc.obj) : error LNK2019: unresolved external symbol DXTraceW referenced in function "long __cdecl DXUTTrace(char const *,unsigned long,long,wchar_t const *,bool)" (?DXUTTrace@@YAJPEBDKJPEB_W_N@Z)
1>DXUTOptional_D_64.lib(SDKmisc.obj) : error LNK2001: unresolved external symbol DXTraceW
1>DXUTOptional_D_64.lib(SDKmisc.obj) : error LNK2019: unresolved external symbol D3DXCreateTextureFromFileExW referenced in function "public: long __cdecl CDXUTResourceCache::CreateTextureFromFileEx(struct IDirect3DDevice9 *,wchar_t const *,unsigned int,unsigned int,unsigned int,unsigned long,enum _D3DFORMAT,enum _D3DPOOL,unsigned long,unsigned long,unsigned long,struct _D3DXIMAGE_INFO *,struct tagPALETTEENTRY *,struct IDirect3DTexture9 * *)" (?CreateTextureFromFileEx@CDXUTResourceCache@@QEAAJPEAUIDirect3DDevice9@@PEB_WIIIKW4_D3DFORMAT@@W4_D3DPOOL@@KKKPEAU_D3DXIMAGE_INFO@@PEAUtagPALETTEENTRY@@PEAPEAUIDirect3DTexture9@@@Z)
1>DXUTOptional_D_64.lib(SDKmisc.obj) : error LNK2019: unresolved external symbol D3DX10CreateTextureFromFileW referenced in function "public: long __cdecl CDXUTResourceCache::CreateTextureFromFileEx(struct ID3D10Device *,wchar_t const *,struct D3DX10_IMAGE_LOAD_INFO *,struct ID3DX10ThreadPump *,struct ID3D10ShaderResourceView * *,bool)"
.....
You may think that all your work is pretty good, and you are all right!
It's very obvious that the problem is caused by missing some libraries.( Because error: error LNK2019: unresolved external symbol ) However, You jsut build a new project ,and you link the DXUT library corrrectly, Why Compiler always always have so many complains? Is it crazy?
继续阅读