Skip to main content
GameDev.net gamedev.net
🔒 Locked 🤖 Godot

Untitled

Started by SulphurTenM Oct 8, 2008 at 5:16 PM 1 replies 1.8k views
Original Post
SulphurTenM
SulphurTenM
I am trying to learn some DirectX 9c (my current GPU doesn't support DirectX 10)... However, my Visual Studio projects do not compile. I have followed this PDF to the letter and my project still fails to link properly. PDF: http://www.d3dcoder.net/Data/Book2/Book2Setup.pdf I have double and triple checked that I have added the directories for the DirectX headers and libs (library paths) - as described in the PDF. Also I am 100% positive that the libs are included in the linker for the project (d3d9.lib, d3dx9d.lib, dxguid.lib, DxErr9.lib, dinput8.lib). I am trying to get a simple "Hello World" program working (from chapter 4 in Source Code Part I from http://www.d3dcoder.net/d3d9c.aspx) I am on Windows XP SP3 using Visual Studio 2005 v8.0.5. DirectX 9.0c version: Summer 2004 Compiling in debug (as opposed to release). As the PDF instructs, I started with an Empty Project. Below is the error message, it shows that "_DXTraceA@20" is unresolved (believed to be in DxErr9.lib - which is linked). Also "_Direct3DCreate9@4" is unresolved (believed to be in d3d9.lib - also linked). Any help on the subject would be greatly appreciated. Error Message:
1>Compiling...
1>d3dApp.cpp
1>HelloDirect3D.cpp
1>Generating Code...
1>Compiling manifest to resources...
1>Linking...
1>d3dApp.obj : error LNK2019: unresolved external symbol _DXTraceA@20 referenced in function "public: virtual void __thiscall D3DApp::initDirect3D(void)" (?initDirect3D@D3DApp@@UAEXXZ)
1>HelloDirect3D.obj : error LNK2001: unresolved external symbol _DXTraceA@20
1>d3dApp.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "public: virtual void __thiscall D3DApp::initDirect3D(void)" (?initDirect3D@D3DApp@@UAEXXZ)
1>HelloDirect3D.obj : error LNK2019: unresolved external symbol _D3DXCreateFontIndirectA@12 referenced in function "public: __thiscall HelloD3DApp::HelloD3DApp(struct HINSTANCE__ *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,enum _D3DDEVTYPE,unsigned long)" (??0HelloD3DApp@@QAE@PAUHINSTANCE__@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4_D3DDEVTYPE@@K@Z)
1>C:\Documents and Settings\Lewis\My Documents\Visual Studio 2005\Projects\DX9 - Tut00b\Debug\DX9 - Tut00b.exe : fatal error LNK1120: 3 unresolved externals
GLUT Setup: -Dev C++ 4.9.9.2GPU: GeForce 7600GT (256mb)CPU: Core 2 Due 1.86RAM: 1Gig
ZeroSum
ZeroSum
It looks like you are not linking to the DirectX libs. Are you already? If you are not you'll need to add d3d9.lib and d3dx9.lib to the linker options in your project properties.

Edit: I need to L2Read, you already link.

Are the libs in the right place? Have you told VS where to find them?
SulphurTenM
SulphurTenM
Ok, if anyone else out there is an idiot like me here was the problem:

I had the library path set to [DirectX SDK/Lib/x64].
I'm running a 32bit machine.
No x86 folder is provided (for summer 2004), so just set it to [DirectX SDK/Lib].

Also, sorry about the lack of topic title.
GLUT Setup: -Dev C++ 4.9.9.2GPU: GeForce 7600GT (256mb)CPU: Core 2 Due 1.86RAM: 1Gig

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.