Archived

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

Setting up DX8, help!

This topic is 5773 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! I''m trying to learn how to program using DirectX. The compiler I''m using is Visual C++. I''ve already installed DX8 SDK, and it''s set in the M$ Visual C++ : Tools -> Options -> Directories But when I try to compile a DX8 program I get the following error: first.obj : error LNK2001: unresolved external symbol "long __stdcall DXTraceA(char *,unsigned long,long,char *,int)" (?DXTraceA@@YGJPADKJ0H@Z) How do I set the compiler (M$ Visual C++) to work with DirectX correctly? thanx! }+TITANIUM+{

Share this post


Link to post
Share on other sites
To prepare visual c++ for DirectX make sure u have to do these steps.
1.Go to Tools->Opions->Directory Tab
Add the path in includes files and library paths of your include and lib installations of the directX.Make sure these paths are at the top.
2.For the project u have to add the lib files in the Project Settings->Link Tab. Forexample ddraw.lib or dinput.lib.

Share this post


Link to post
Share on other sites
ALWAYS include dxguid.lib, other than that the listing of lib.s needed for interfaces are in the docs. Which come in both word and help file format, and are included with the SDK install. Not to menchon they are available online at http://msdn.microsoft.com

Share this post


Link to post
Share on other sites
hmmmm.... thanx
but still, what am I looking for? I know how to use a help file, but "what am I looking for"?
I've just started to use VC++ and program in windows, I have no idea how to find exactly what .lib I need. Should I go throuh all the functions? Or just look at .h files what they need?

*completely lost*

}+TITANIUM+{

Edited by - Seriema on June 22, 2001 2:02:06 PM

Share this post


Link to post
Share on other sites
I''m looking at the error message:
first.obj : error LNK2001: unresolved external symbol "long __stdcall DXTraceA(char *,unsigned long,long,char *,int)" (?DXTraceA@@YGJPADKJ0H@Z)

Do you know what hits me? That I _don''t_ use any "DXTraceA" anywhere in my program! Then why is it complaining?

Please help! I''ve been trying for days now =(

}+TITANIUM+{

Share this post


Link to post
Share on other sites
Gah I can''t let you sit there suffering like that! I had the same problem too when I was starting out, do this:

In VC++ go to "Tools | Options..." and choose the "Directories" tab. Make sure the "Platform" list is set to "Win32" and then select "Include files" under the "Show directories for:" list.

Add the "INCLUDE" folder of your DX8 installation directory (mine is "C:\C++\DX8 SDK\INCLUDE") to the list. Move the entry you have just made to the very top of the list.

Change the "Show directories for:" option to "Library files".

Add the "LIB" folder to the list and move it to the top just as you did with the "INCLUDE" folder.

Close the Options box.

Click on "Project | Settings..." and select the "Link" tab.

In the "Object/library modules:" text box add "d3d8.lib d3dx8.lib" to the end of the list. Add the same two files to the "Project Options:" text box (next to the other .lib files in the box, not at the end).

Right, I don''t think I''ve missed anything - your code should compile now without that nasty error message you''re getting.

Best of luck,
Gareth

Share this post


Link to post
Share on other sites
I found the following function call in my program:
DXTrace(__FILE__, __LINE__, hResult, "Can''t Get Adapter Mode", TRUE);
When I remove it with //, it compiles just fine! But the linker error was on DXTraceA. I don''t get it... Is the function call wrong?

THANK YOU FOR ALL YOUR HELP!!! =)

}+TITANIUM+{

Share this post


Link to post
Share on other sites
It''s not wrong, you just aren''t linking to the files that declare that stuff. As to what you are "looking for" to include, its all the libraries that you use in your project. If you make calls to D3D, then you must include the d3d.lib in your project settings. If you can''t figure out what libraries to link to, then you should open one of the example programs that comes with dx8 sdk and copy all the libs that pertain to dx8 from the project setting and paste them into your project.

Good Luck =)

Mike Barela
MikeB@yaya.com

Share this post


Link to post
Share on other sites
first.obj : error LNK2001: unresolved external symbol "long __stdcall DXTraceA(char *,unsigned long,long,char *,int)" (?DXTraceA@@YGJPADKJ0H@Z)

You need to include dxerr8.h
and link dxerr8.lib (make sure this is added under settings under the project)


Hope this helps

Share this post


Link to post
Share on other sites