Problem compiling DirectDraw code
I''m using MSVC and have the DirectX 8.1 sdk installed and set up correct. I double-checked to make sure I''ve included the proper library files. I''ve looked through MSDN to see if there was a solution there, but nothing found. The problem is I''ve started to make a simple game with DirectDraw and it gives me a linker error when I tries to create the DirectDraw object. The error is:
main.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
Debug/noob_pong.exe : fatal error LNK1120: 1 unresolved externals
The line of code that looks to be the problem is this:
hResult = DirectDrawCreateEx(NULL, (LPVOID *)&lpDD, IID_IDirectDraw7, NULL);
Now I know this works because I compiled an example from Teach Yourself DirectX 7 in 24 Hours that had the exact same line of code and got the program to work. Could anyone help me out here?
Are you linking to dxguid.lib?
If so, are you sure that the include and header directories for the DX8 SDK are listed *before* the default directories in Tools->Options?
If so, are you sure that the include and header directories for the DX8 SDK are listed *before* the default directories in Tools->Options?
Thank you so much! The problem was I needed to link the dxguid.lib file. I didn''t realize that was necessary. Is that needed for all DirectX programs that I make?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement