Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linker errors\DirectX

Status
Not open for further replies.

SoulSkorpion

Technical User
Sep 1, 2002
7
AU
(note: I originally posted this on another forum, and nobody was able to help me. I have since then tried with the latest DirectX SDK, with no change).

I'm trying to learn DirectX, using code out of a "teach yourself DirectX" book, using the DirectX SDK on the CD that comes with the book (version 8. Yes, I know it's out of date, but this way I know that the code in the book is going to get exactly what it's expecting).

Anyway, I can't get one of the examples to compile. Well, technically I can get it to compile but I can't get it to link in the DirectX stuff. I've tried using MSVC++ 5 (the latest version I could get my hands on) and Bloodshed's Dev-C++.

With MSVC++, when I try to build the projet I get the single error message:

c:\DXSDK\lib\d3d8.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x3b16034b

which is Greek to me. And with Dev-C++ I get:
[Linker error] undefined reference to 'Direct3DCreate8@4'

I thought maybe it had something to do with including the DirectX libraries and whatnot in the standard libraries (you know, so the files themselves don't have to be copied and manually included with the project each time) but even copying the files directly and including them didn't work. I can't decipher these error messages; can anyone else?

I've tried to change the options so that the DirectX stuff gets included in the standard library (you know, so that you don't have to use &quot;&quot;s and copy the files across and can use <>s instead? As in #include <d3d8.h> instead of #include &quot;d3d8.h&quot;).

SoulSkorpion

PS: I would include the code in this post, but there's quite a lot of it and I don't think the problem's in the code. If anyone really wants to see it, I will.
 
If c:\DXSDK\lib\d3d8.lib really exist then try to check disk if it is really full. Ion Filipski
1c.bmp


filipski@excite.com
 
Nope. The file most definately exists, and I've got 8.74GB free on the hard disk :/
 
Maybe the .lib is corrupt or is not compilled with VisualC++? Ion Filipski
1c.bmp


filipski@excite.com
 
I don't think it's corrupt. I tried downloading the latest SDK, with no change. I guess I could check the file's md5sum, if it's available anywhere...
 
You could check out NeXe's DirectX setup steps for including things like library paths. ( It also mentions adding a number of library files to the project settings, which is something I don't like doing, b/c then when sharing code, that's one more detail that needs to go with. I generally just use compiler directives, such as:

Code:
#pragma comment (lib, &quot;dxguid.lib&quot;)
#pragma comment (lib, &quot;d3d8.lib&quot;)
#pragma comment (lib, &quot;d3dx8.lib&quot;)

I'm using Visual Studio 6.0 in Win2k, and when installing the DX9 SDK, it did all the work for adding library paths for me. Now I just add those three lines and I'm ready to go.

I started with some OpenGL last fall but didn't really like it. About a week ago I tried DirectX...I think I like it better, but it's too early to tell. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
The stuff in that link didn't help. I'd already set those directories to include the Direct X lib and bin and include directories.

This is exactly what I've done so far:

I went to tools\options, clicked the diretory tab. Under &quot;include files&quot; I added &quot;C:\DIRECTX9SDK\INCLUDE&quot;, (C:\DIRECTX9SDK is where it's installed. I checked that ;) ). Under &quot;executable files&quot; I added &quot;C:\DIRECTX9SDK\BIN&quot;. Under library files I added &quot;C:\DIRECTX9SDK\LIB&quot;. Under &quot;source files&quot; I added &quot;C:\DIRECTX9SDK\&quot;

Does that help? :/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top