------ Build started: Project: wndprogtest, Configuration: Debug Win32 ------ Linking... wndprogtest.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7 C:\Documents and Settings\Matt\Desktop\wndprogtest\Debug\wndprogtest.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\Documents and Settings\Matt\Desktop\wndprogtest\wndprogtest\Debug\BuildLog.htm" wndprogtest - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
cant use directx in visual studio
Started by Ziel, Jun 29 2008 07:01 PM
4 replies to this topic
#1 Members - Reputation: 124
Posted 29 June 2008 - 07:01 PM
Everytime I try to compile my program that uses DirectX, it wont compile :(. I'm completely new to using DirectX in programming. Someone help me please, thanks in advance!
Sponsor:
#2 Moderators - Reputation: 13610
Posted 29 June 2008 - 07:48 PM
It sounds like you're new to using API's in general ;)
You've got a classic linker error there - after compiling (it did compile successfully if it's up to the linking stage), the linker has to put all the bits of compiled code together, including any API's that you're using.
In this case, the linker is telling you that it can't find the DirectX files that it needs.
Go into the properties of your project, then into the Linker section, and then the "Additional Dependencies" field. Add d3d.lib and d3dx.lib to this field.
You've got a classic linker error there - after compiling (it did compile successfully if it's up to the linking stage), the linker has to put all the bits of compiled code together, including any API's that you're using.
In this case, the linker is telling you that it can't find the DirectX files that it needs.
Go into the properties of your project, then into the Linker section, and then the "Additional Dependencies" field. Add d3d.lib and d3dx.lib to this field.
#3 Members - Reputation: 124
Posted 29 June 2008 - 08:02 PM
------ Build started: Project: wndprogtest, Configuration: Debug Win32 ------
Compiling...
wndprogtest.cpp
Linking...
LINK : fatal error LNK1104: cannot open file 'd3d.lib'
Build log was saved at "file://c:\Documents and Settings\Matt\Desktop\wndprogtest\wndprogtest\Debug\BuildLog.htm"
wndprogtest - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Compiling...
wndprogtest.cpp
Linking...
LINK : fatal error LNK1104: cannot open file 'd3d.lib'
Build log was saved at "file://c:\Documents and Settings\Matt\Desktop\wndprogtest\wndprogtest\Debug\BuildLog.htm"
wndprogtest - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#4 Moderators - Reputation: 13610
Posted 29 June 2008 - 08:20 PM
Ok, looks like your IDE isn't configured to locate the DirectX SDK installation.
This step varies a bit depending on which version of Visual Studio you're using.
1) Go to Tools menu -> Options....
On VS 2005:
2) Select Projects and Solutions -> VC++ Directories.
On VS 2003:
2) Select Projects -> VC++ Directories.
3) Then select "Library Files" from the top-right drop-down box, and add "C:\Program Files\Microsoft DirectX SDK (February 2007)\Lib\x86" to the list (but change the path to what your actual DX SDK install directory is).
[EDIT]Arg! You can probably ignore this post so far.
I gave you the wrong library name before! Sorry, that should be d3d9.lib (or d3d8.lib etc depending on which SDK version you have installed), not d3d.lib.
This step varies a bit depending on which version of Visual Studio you're using.
1) Go to Tools menu -> Options....
On VS 2005:
2) Select Projects and Solutions -> VC++ Directories.
On VS 2003:
2) Select Projects -> VC++ Directories.
3) Then select "Library Files" from the top-right drop-down box, and add "C:\Program Files\Microsoft DirectX SDK (February 2007)\Lib\x86" to the list (but change the path to what your actual DX SDK install directory is).
[EDIT]Arg! You can probably ignore this post so far.
I gave you the wrong library name before! Sorry, that should be d3d9.lib (or d3d8.lib etc depending on which SDK version you have installed), not d3d.lib.
#5 Moderators - Reputation: 1918
Posted 29 June 2008 - 10:40 PM
Quote:Actually, IID_IDirectDraw7 is in dxguid.lib, and you'll probably need ddraw.lib too.
Original post by Hodgman
[EDIT]Arg! You can probably ignore this post so far.
I gave you the wrong library name before! Sorry, that should be d3d9.lib (or d3d8.lib etc depending on which SDK version you have installed), not d3d.lib.
Although, I'd highly recommend against using DirectDraw - it's not hardware accelerated, it's out of date, and it needs a lot of code to get stuff working. I'd recommend going for Direct3D instead.






