Author Topic: .OBJ Error  (Read 10046 times)

IcedMetal

  • Guest
.OBJ Error
« on: November 16, 2005, 01:47:26 am »
Well, at first I had some issues with cvtres.exe, but I got that resolved. Now when I try to compile the "Donuts4" sample that comes with the DirextX 9 SDK, I get errors related to the obj files it uses. I have no idea whats going on. Here are the errors;
Code
d3dfile.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileA@12 referenced in function "public: long __thiscall CD3DMesh::Create(struct IDirect3DDevice9 *,char *)" (?Create@CD3DMesh@@QAEJPAUIDirect3DDevice9@@PAD@Z)
d3dfile.obj : error LNK2019: unresolved external symbol _D3DXLoadMeshFromXA@32 referenced in function "public: long __thiscall CD3DMesh::Create(struct IDirect3DDevice9 *,char *)" (?Create@CD3DMesh@@QAEJPAUIDirect3DDevice9@@PAD@Z)
d3dfile.obj : error LNK2019: unresolved external symbol _D3DXLoadMeshFromXof@32 referenced in function "public: long __thiscall CD3DMesh::Create(struct IDirect3DDevice9 *,struct IDirectXFileData *)" (?Create@CD3DMesh@@QAEJPAUIDirect3DDevice9@@PAUIDirectXFileData@@@Z)
d3dfile.obj : error LNK2019: unresolved external symbol _D3DXComputeNormals@8 referenced in function "public: long __thiscall CD3DMesh::SetFVF(struct IDirect3DDevice9 *,unsigned long)" (?SetFVF@CD3DMesh@@QAEJPAUIDirect3DDevice9@@K@Z)
Bullet.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
EnemyShip.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
donuts.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
gamemenu.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
d3dfile.obj : error LNK2019: unresolved external symbol _D3DXMatrixMultiply@12 referenced in function "public: long __thiscall CD3DFrame::Render(struct IDirect3DDevice9 *,bool,bool,struct D3DXMATRIX *)" (?Render@CD3DFrame@@QAEJPAUIDirect3DDevice9@@_N1PAUD3DXMATRIX@@@Z)
d3dutil.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
3DDisplayObject.obj : error LNK2019: unresolved external symbol _D3DXMatrixMultiply@12 referenced in function "public: long __thiscall C3DDisplayObject::ResolveCollsionWithGroundPt(struct D3DXVECTOR3 const &,struct D3DXVECTOR3 const &)" (?ResolveCollsionWithGroundPt@C3DDisplayObject@@QAEJABUD3DXVECTOR3@@0@Z)
3DDrawManager.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
d3dfile.obj : error LNK2019: unresolved external symbol _DirectXFileCreate@4 referenced in function "public: long __thiscall CD3DFile::CreateFromResource(struct IDirect3DDevice9 *,char *,char *)" (?CreateFromResource@CD3DFile@@QAEJPAUIDirect3DDevice9@@PAD1@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__CreateFontA@56 referenced in function "private: long __thiscall CD3DFont::CreateGDIFont(struct HDC__ *,struct HFONT__ * *)" (?CreateGDIFont@CD3DFont@@AAEJPAUHDC__@@PAPAUHFONT__@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__GetDeviceCaps@8 referenced in function "private: long __thiscall CD3DFont::CreateGDIFont(struct HDC__ *,struct HFONT__ * *)" (?CreateGDIFont@CD3DFont@@AAEJPAUHDC__@@PAPAUHFONT__@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__ExtTextOutA@32 referenced in function "private: long __thiscall CD3DFont::PaintAlphabet(struct HDC__ *,int)" (?PaintAlphabet@CD3DFont@@AAEJPAUHDC__@@H@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__GetTextExtentPoint32A@16 referenced in function "private: long __thiscall CD3DFont::PaintAlphabet(struct HDC__ *,int)" (?PaintAlphabet@CD3DFont@@AAEJPAUHDC__@@H@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dutil.obj : error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function "void __cdecl D3DUtil_InitMaterial(struct _D3DMATERIAL9 &,float,float,float,float)" (?D3DUtil_InitMaterial@@YAXAAU_D3DMATERIAL9@@MMMM@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__SetTextAlign@8 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__SetBkColor@8 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__SetTextColor@8 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__CreateDIBSection@24 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dutil.obj : error LNK2001: unresolved external symbol __imp__DeleteObject@4
d3dfont.obj : error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dutil.obj : error LNK2001: unresolved external symbol __imp__SelectObject@8
d3dfont.obj : error LNK2019: unresolved external symbol __imp__SetMapMode@8 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dfont.obj : error LNK2019: unresolved external symbol __imp__CreateCompatibleDC@4 referenced in function "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z)
d3dutil.obj : error LNK2001: unresolved external symbol __imp__CreateCompatibleDC@4
TerrainMesh.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function "public: long __thiscall CTerrainMesh::CreateMeshFromHeightMap(int,int)" (?CreateMeshFromHeightMap@CTerrainMesh@@QAEJHH@Z)
donuts.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function "protected: long __thiscall CMyApplication::InitDeviceObjects(struct HWND__ *)" (?InitDeviceObjects@CMyApplication@@IAEJPAUHWND__@@@Z)
d3dutil.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function "void __cdecl D3DUtil_InitLight(struct _D3DLIGHT9 &,enum _D3DLIGHTTYPE,float,float,float)" (?D3DUtil_InitLight@@YAXAAU_D3DLIGHT9@@W4_D3DLIGHTTYPE@@MMM@Z)
3DDisplayObject.obj : error LNK2001: unresolved external symbol _D3DXVec3Normalize@8
StdAfx.obj : error LNK2001: unresolved external symbol _D3DXVec3Normalize@8
TerrainEngine.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function "public: long __thiscall CTerrainEngine::OneTimeSceneInit(class CThemeStyle *)" (?OneTimeSceneInit@CTerrainEngine@@QAEJPAVCThemeStyle@@@Z)
d3dutil.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileExA@56 referenced in function "long __cdecl D3DUtil_CreateTexture(struct IDirect3DDevice9 *,char *,struct IDirect3DTexture9 * *,enum _D3DFORMAT)" (?D3DUtil_CreateTexture@@YAJPAUIDirect3DDevice9@@PADPAPAUIDirect3DTexture9@@W4_D3DFORMAT@@@Z)
HeightMap.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileExA@56
TerrainMesh.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileExA@56 referenced in function "public: long __thiscall CTerrainMesh::RestoreDeviceObjects(struct HWND__ *)" (?RestoreDeviceObjects@CTerrainMesh@@QAEJPAUHWND__@@@Z)
donuts.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileExA@56 referenced in function "protected: long __thiscall CMyApplication::InitDeviceObjects(struct HWND__ *)" (?InitDeviceObjects@CMyApplication@@IAEJPAUHWND__@@@Z)
d3dutil.obj : error LNK2019: unresolved external symbol _D3DXMatrixLookAtLH@16 referenced in function "struct D3DXMATRIX __cdecl D3DUtil_GetCubeMapViewMatrix(unsigned long)" (?D3DUtil_GetCubeMapViewMatrix@@YA?AUD3DXMATRIX@@K@Z)
gamemenu.obj : error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16
d3dutil.obj : error LNK2019: unresolved external symbol _D3DXQuaternionRotationAxis@12 referenced in function "struct D3DXQUATERNION __cdecl D3DUtil_GetRotationFromCursor(struct HWND__ *,float)" (?D3DUtil_GetRotationFromCursor@@YA?AUD3DXQUATERNION@@PAUHWND__@@M@Z)
d3dutil.obj : error LNK2019: unresolved external symbol __imp__ScreenToClient@8 referenced in function "struct D3DXQUATERNION __cdecl D3DUtil_GetRotationFromCursor(struct HWND__ *,float)" (?D3DUtil_GetRotationFromCursor@@YA?AUD3DXQUATERNION@@PAUHWND__@@M@Z)
d3dutil.obj : error LNK2019: unresolved external symbol __imp__GetClientRect@8 referenced in function "struct D3DXQUATERNION __cdecl D3DUtil_GetRotationFromCursor(struct HWND__ *,float)" (?D3DUtil_GetRotationFromCursor@@YA?AUD3DXQUATERNION@@PAUHWND__@@M@Z)
donuts.obj : error LNK2001: unresolved external symbol __imp__GetClientRect@8
d3dutil.obj : error LNK2019: unresolved external symbol __imp__GetCursorPos@4 referenced in function "struct D3DXQUATERNION __cdecl D3DUtil_GetRotationFromCursor(struct HWND__ *,float)" (?D3DUtil_GetRotationFromCursor@@YA?AUD3DXQUATERNION@@PAUHWND__@@M@Z)
d3dutil.obj : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "long __cdecl D3DUtil_SetDeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,int)" (?D3DUtil_SetDeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@H@Z)
d3dutil.obj : error LNK2019: unresolved external symbol __imp__GetDIBits@28 referenced in function "long __cdecl D3DUtil_SetDeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,int)" (?D3DUtil_SetDeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@H@Z)
d3dutil.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "long __cdecl D3DUtil_SetDeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,int)" (?D3DUtil_SetDeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@H@Z)
Process terminated with status 1 (0 minutes, 4 seconds)

Also, when I import the project I get this error;
Code
19:44:01: The path 'D:d3dfile.cpp' contains too many ".."!
19:44:01: The path 'D:d3dfile.h' contains too many ".."!
19:44:01: The path 'D:d3dfont.cpp' contains too many ".."!
19:44:01: The path 'D:d3dfont.h' contains too many ".."!
19:44:01: The path 'D:d3dutil.cpp' contains too many ".."!
19:44:01: The path 'D:d3dutil.h' contains too many ".."!
19:44:01: The path 'D:diutil.cpp' contains too many ".."!
19:44:01: The path 'D:diutil.h' contains too many ".."!
19:44:01: The path 'D:dmutil.cpp' contains too many ".."!
19:44:01: The path 'D:dmutil.h' contains too many ".."!
19:44:01: The path 'D:dsutil.cpp' contains too many ".."!
19:44:01: The path 'D:dsutil.h' contains too many ".."!
19:44:01: The path 'D:dxutil.cpp' contains too many ".."!
19:44:01: The path 'D:dxutil.h' contains too many ".."!

I'm pretty sure I know what is wrong with that part, just, how do I fix it? Help would be greatly appreciated.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: .OBJ Error
« Reply #1 on: November 16, 2005, 10:53:44 am »
Hello,

In the forum archive, there are at least one or two topics on DirectX that might be helpful or point you to the correct direction.

Check if you have installed the Microsoft Platform SDK and if all directories have been correctly inserted in C::B. Check if you have all the libraries DirectX needs.

If you can, try to compile the sample with Visual Studio .NET and see if it works (if you have no Visual Studio .NET 2003, you can try with the free Visual Studio C++ 2005 Express Edition).

Best wishes,
Michael

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: .OBJ Error
« Reply #2 on: November 16, 2005, 11:07:10 am »
Add gdi32.lib and d3dx.lib (or something like it) in link libraries.
A forum search should give you the answer...
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: .OBJ Error
« Reply #3 on: November 16, 2005, 06:58:39 pm »
Hello,

I have tried some DirectX samples (Direct3D) with not a lot of success (I have Microsoft DirectX 9.0 SDK (October 2005)). Still some libraries are missing and adding gdi32.lib does not solve the problem. Moreover, the same samples do not compile under .NET 2003 too :?. May be the problem is partially related to the fact that the sample projects make use of PCHs which are not actually supported by C::B and Visual Studio C++ Toolkit 2003 ( :().

I have not created and empty project and then manually added the sample files, but I have imported the given .NET 2003 solution with C::B. I have also tried to import a bit older Dev-C++ project (DirectX sample), but still without success.

I think that the best solution (and the most time-consuming) would be to create a new project and to add the necessary files. I will give it a try.

Best wishes,
Michael

All0i5hu5

  • Guest
Re: .OBJ Error
« Reply #4 on: November 21, 2005, 11:35:06 pm »
If the libraries are missing, and you know the libraries for it, then search the PC for them and put those in the paths.

I think the examples I have provided on the other thread are pretty good, as I have now compiled 6 or 7 of the samples that come with the DirectX SDK, and am working on my own projects now, that compile.

For the original poster (Iced Metal), make sure you go to Settings -> Compiler -> Linker and add the necessary libraries. In this case, D3dx8.lib as indicated by:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/directx_cpp/graphics_func_d3dx_15vc.asp

If you do a search on your pc and do not find that lib, then you wont be able to compile the project. Also make sure that the Directories and such under Settings contains the correct paths to the bins and includes.

Michael: You can go that route if you would like, but it is harder to get the examples to compile. You will have to create your own manifest file, and also copy the files from the original locations (common) to include with the project.

I think your compiler is missing your libraries. If you have the SDKs, then it is probably that you have the libraries, but do not have the correct directories added in C::B.

If you post your exact errors that you are getting, I am sure I can give you a hand with that.

IcedMetal

  • Guest
Re: .OBJ Error
« Reply #5 on: November 22, 2005, 01:45:06 am »
Yeah, it was stupid me who forgot all the libraries. Thanks for the help guys. It compiled with 0 errors :)