• Advertisement

Archived

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

[DX8] Help!

This topic is 6210 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

I just copied a tutorial to my PC and I''m getting the error message when the compiler is linking: d:\c++ development\projects\spacegame\window.o: In function `WinMain'': //d/c++ development/projects/spacegame/window.cpp:124: undefined reference to `D3DXShutdown(void)'' d:\c++ development\projects\spacegame\d3dx_methods.o: In function `D3DXInit(HWND__ *)'': //d/c++ development/projects/spacegame/d3dx_methods.cpp:49: undefined reference to `Direct3DCreate8@4'' D3DXInit() is a method I''ve created which just initializes all the D3DX objects. Direct3DCreate8 is a built in DX8 method, is it not? Any suggestions would be appretiated.. I can''t seem to figure out what "undefined reference" should mean?

Share this post


Link to post
Share on other sites
Advertisement
Do I need to write something into the .cpp file for this?

I copied this right out of a tutorial, and they didn''t mention anything..

I have:

#include "windows.h"
#include "d3dx8.h"

- is this what I need? As far as I knew this was it..

Also, in my compiler options I''m including my dx8 sdk directory under libraries.

It also might help to know i''m using Dev C++
Thanks for the help!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You need to add the DirectX libraries to the linker. Go to Project - Settings - Than click on the link tab. You need to add d3d.lib to the list of all the other include libraries. You also need to tell the compiler where to find the library, and the DirectX headers (It is probably finding the old ones). So close that window go to Tools - Options than click on the directories tab, select include from under the show directories for box, and add the path to your directX headers. Now select Library files from the Show Directories for box, and add the path to your directX libraries. Move both of these paths to the top of the list (The compiler will use the first one it finds). Hope I didn''t confuse you more.

Share this post


Link to post
Share on other sites
I don''t think you''re looking at Dev C++. I already have the sdk directories included in the compiler options.

I can''t see any menus like that either way..

Is there anybody who has Dev C++ who has had a similar problem

Share this post


Link to post
Share on other sites
Really... Help!

I''m really confused here... I think I have everything included that I need to include, I''ve been able to compile some other small projects (but nothing major) - do these error messages mean anything to you guys?

I appretiate your time and help!



- Flanders -

Share this post


Link to post
Share on other sites
I have no experience with Dev C++ (altough I have heard its a decent IDE) but this *should* work, provided you have your directories set up correctly.

  
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "d3d8.lib")
#pragma comment(lib, " ENTER OTHER LIBRARY''S HERE ")


So you should make a #pragma comment(lib, ...) line for every DirectX library you want to use.

You can insert that code anywhere in your project, it doesn''t really matter where as long as the compiler executes it at least once.

Hope this helps a little.





ALL YOUR BASE ARE BELONG TO US

Share this post


Link to post
Share on other sites
Thanks, I''ll try it..

out of curiosity, what does this do?

You can set the libraries at compile time?

Is this an assembler directive?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Arrggghh So Frustrating..... so fun!! This is what programming is about

Hehe... well, it would be better if I had programming issues to deal with

Same error message... I think there''s something with Dev++ here?

Share this post


Link to post
Share on other sites
Maybe you installed the DirectX 7 SDK instead of the DirectX 8 SDK?

Come to think of it, you prolly didn''t install a SDK at all... If thats the case, go to www.microsoft.com/directx and download the DirectX 8.0 Software Development Kit.





ALL YOUR BASE ARE BELONG TO US

Share this post


Link to post
Share on other sites
I also have a copy of Dev C++ and have even updated to version 4.1, but I can not find anyway of creating DX8 apps. I have used GLUT with no problems - but the same method but still it wont work. I have tried the idears from the FAQ on the developers website, any other idears?

Share this post


Link to post
Share on other sites
Messed with it a little, I think I'll give up with this IDE and use the MSVC IDE which comes with Lamothe's book.

If I'm really screwed I'll go out and buy a MSVC IDE

Edited by - Flanders on February 21, 2001 7:02:18 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
DirectX is just like any other library except it uses COM. It is linked to like anything else. Make sure that you have the *.a libraries in the lib directory.

Share this post


Link to post
Share on other sites

  • Advertisement