Archived

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

direct draw problem

This topic is 5653 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 [edited by - deadlydog on June 25, 2002 5:42:34 PM]

Share this post


Link to post
Share on other sites
How to include the DirectX header directories in your compiler''s search directories: somewhat complicated, and it depends on the compiler system and environment you''re using. If you''re using a dos-based command-line compiler, probably what you should do is this:
Edit your autoexec.bat file, residing in the root directory of your drive, adding a line saying: set CPLUS_INCLUDE_PATH=*directx headers*;*standard headers*;*other headers*
(you could also do the same with C_INCLUDE_PATH).
If you are not using a command-line based compiler, you''ll need to find an option somewhere in the program you run to compile things that allows you to specify additional directories to search for different kinds of files.

Twilight Dragon
Win32 API Expert
www.freewebz.com/j-world

Share this post


Link to post
Share on other sites
the header files seem to be found, since there''s a linker error, the compiler must have found the files, but nevertheless I''d set the path since it may be the old versions that came with your compiler. what you need to set is the path to your directx library files. Here''s how to do both in vc++ 6:
Start up vc++ (yeah, really )
Then choose Extras -> Options -> Directories
Choose Include Files in the List-Box, click new and enter the path to your header files. (ex: C:\DX8SDK\include)
Choose Library Files in the List-Box, click new and enter the path to your library files. (ex: C:\DX8SDK\lib)

I just translated the names of the menus etc. from what is there in my german version of vc++, hope the names are half-way correct

Share this post


Link to post
Share on other sites
The last reply should fix your problem, or try #define INITGUID at the top of the file that uses any guids - BEFORE including any header files. There may be an underscore(_) between INIT and GUID but I think I have it right.

"Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.

Share this post


Link to post
Share on other sites