Archived

This topic is now archived and is closed to further replies.

direct draw problem

This topic is 5651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I''m new to this whole direct x thing and I''m reading Tricks of the Windows Game Programming Gurus and I''m in the direct draw section right now. I''m trying to compile one of the demo direct draw programs but I keep getting this error: demo6_1.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4 Debug/test.exe : fatal error LNK1120: 1 unresolved externals The book says to include the ddraw.lib which I have done, and also to include the directX header paths to my compliers .H''s search directories as the first directory. How exactly do I do that?? Thnx in advance He who laughs, lasts He who laughs, lasts

Share this post


Link to post
Share on other sites
The error implies that a lib is missing, not a header. In your case the linker doesn''t recognize the GUID IID_IDirectDraw4 -> you need to include dxguid.lib as well.

As for the paths go to Tools -> Options -> Directories, select the ''Include Files'' from the list on the right, add the path to the DX SDK in the list below and use the up button to move the path to the top of the list.

Share this post


Link to post
Share on other sites
Hey,

Don''t forget to set your library directories, too. This is done exactly like changing your header directors as Christian described it, except instead of selecting ''Include files'' and adding the directory you select ''Library files'' and add the directory.

Also, don''t forget that the path you add is not simply the path to the DX SDK folder. You need to be specific (for include files it would be something like "c:\mssdk\include" and for the library files it would be something like "c:\mssdk\lib").

Hope that helps,
--Brian

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
in VC++, can write this to your source code,
tell compiler used library

#pragma comment (lib, "ddraw.lib"
#pragma comment (lib, "dxguid.lib"

ya, my english is bad.

Made In Taiwan, Republic Of China.

Share this post


Link to post
Share on other sites