User forums > Help
Cannot find -ldxerr when linking
Biplab:
1. You can't link MSVC compiled libraries against GCC compiled object files.
2. Don't use MSVC compiler options for GCC. E.g., /DEFAULTLIB:"uuid.lib" is applicable for MSVC only.
TwoD:
Sigh... All this is driving me nuts. Thank you all for still replying despite my somewhat extremely complete and utter confusion on this matter. :?
Brace yourselves tho, it's getting worse. I've decided I need to start over from scratch to understand how to make my D3D(X) programs compile, link and run (with Wine) in Linux, as well as run in Windows without code changes.
In reply to Biplab:
1. From what I've read, the "self hosted MinGW version" will have the ability to link with a .dll/.lib pair created with MSVC, but I don't know which actual version that is (I'm using the one from Ubuntu repositories), nor am I certain that's true since every piece of documentation I've come across so far has been extremely confusing. Most of the FAQs or HowTo's I've come across are either exact copies or rewordings of the MinGW official FAQ, which in turn is IMHO gibberish.
The few texts I've found which I could make sense of says that to link with a Windows-dll, I need either a .lib-file (must be the one included with the 3rd party library, such as d3dx9.lib, righ? But you say that won't cut it because of incompatibilities) or an .a file, which I obviosly don't have since d3d's obviously been compiled for Windows with MSVC.
To create a .a file I need a .def file with all the symbols available in the .dll. Of course I don't have a .def file either.
To create a .def file I could use the .dll and the dllwrap tool. (Other tools like dlltool, libtool, nm are also mentioned for the various tasks needed to get the elusive .a file I need for linking, but the following "issues" apply to them as well) The .dll in my case would be d3dx9_xx.dll, right? I grabbed one (d3dx9_35.dll) from my Vista installation to test.
I have i586-mingw32msvc-dllwrap which came with MinGW, is this the tool they mean? I don't know what the actual difference is compared to just "dllwrap" (which I don't have). Some of the other tools I do have two versions of, the "regular" ones without "i586-mingw32msvc" and those with. What is what and why?
Anyway, I tried using i586-mingw32msv-dllwrap with the specified switches, but all it produced was an empty .def file and then said there were no symbols found. :(
I'm once again lost...
I tried an alternative route; find .a files someone else had already made for d3dx.
I came across this page: http://mywebpage.netscape.com/PtrPck/directx.htm, where someone has made import libraries for d3dx8. Wrong version I know but I gave it a shot just to see what happened.
I added the new d3dx path to the Project's Search Directories -> Linker in CB to point to the files I downloaded from the above site and compiled.
Compile worked fine, and linking too (no segfault), except for a few undefined references to methods like _D3DXCreateEffectFromFileA@32 which I presume is because I used d3dx9 headers but only had the d3dx8 import library.
I tried to follow the guide on the link above to create import libraries for d3dx9 as well, but lost him when he mentions a tool called "reimp" which I don't have.
2. I don't know where that compiler option is set. I have not set it explicitly so I'm thinking it's somehow added by the D3D(X) headers.
The only reason I keep trying to do this is that I tell myself I'm learning something new, which I will benefit from greatly later on. But I will owe much of the effort to all of you who keep replying, so thank you all once again!
dosboot:
Yep, this sounds exactly right. I was in your situation a year or two ago. Same DirectX version (August 2006 SDK). Searched and found the same site with the dxerr header that didn't work. Tried to create .def files using tools I have no clue about but got the same empty file....
Unfortunately I gave up. This is something that has to be taught. In the end it probably won't be complicated, it is just very hard to learn in isolation. How everyone else in the world learned all one needs to know about .dll/.lib/.a/.def files is beyond me.
Ah well. As you found out, since only the error library is affected you can sort of get by without solving the problem. My project seems to be working nicely, with no misbehavior from the other DirectX calls I've thrown at it. I can try to help if you ever need to compare notes with another person compiling DirectX on mingw.
TwoD:
I finally managed to get it all working, and get a grip on some of the things I was so confused about.
After some additional searching and rewordings of my queries I discovered this site: http://devpaks.org/ which has "adapted" libraries for Dev-C++.
Someone has already gone through the hassle of porting the DX 9.0c .libs (including D3DX) to .a files and uploaded it here: http://devpaks.org/details.php?devpak=136
I'm unsure which actual SDK version it is, and I can't check atm since my comp isn't up (moving to our new place took waaaay longer than expected), but I know it atleast works with what I needed from the Aug 2006 version. As noted on devpak's front page, the .devpak file is just a renamed .tar.bz2, and they are not responsible for what it contains!
I even managed to create a Linux version of another library I used and I've been thinking of writing a small tutorial on how to do it. It would probably be very similar to the tutorials mentioned here, but with some more focus on DX and elaborations on why you do each step, and with links to any programs/libs etc.
I'd be glad to compare notes some time. =)
dosboot:
The download link doesn't seem to be working anymore. Any idea where else I could get this?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version