[DevC++] dll with directx 9.0c support available
Have any of you ever tried compiling with the d3d9.lib directly from the DX SDK ?
http://www.mingw.org/mingwfaq.shtml#faq-msvcdll
In Codeblocks (and DevC) with the mingw compiler I just add the DXSDK(oct. 2005) include and lib folders as usual, then d3d9.lib through the "build options/linker settings/link libraries/Add".
(note: it appears to require the full path or relative path)
Also changed IrrCompileconfig.h to only compile dx9
I don't use any dev pack or convert anything.
http://www.mingw.org/mingwfaq.shtml#faq-msvcdll
In Codeblocks (and DevC) with the mingw compiler I just add the DXSDK(oct. 2005) include and lib folders as usual, then d3d9.lib through the "build options/linker settings/link libraries/Add".
(note: it appears to require the full path or relative path)
Code: Select all
../../../DXSDK1005/Lib/x86/d3d9.lib
I don't use any dev pack or convert anything.
Last edited by kh_ on Tue Jan 27, 2009 1:47 am, edited 17 times in total.
I have recently switched to CODE::BLOCKS from DevC++ and I tried to recompile Irrlicht 1.2 with DirectX9 support.
After a few tries I suspected that the Devpak for DevC++ I was using was too old to work with latest DirectX functions, so I tried to use the latest DirectX SDK (in this case, october 2006 release), as HF suggested a few posts above this one.
Since I use Mingw, I have converted the .libs files contained in the SDK to .a files with REIMP (detailed instructions on REIMP in gfxstyler's post HERE).. all worked flawlessly and the new .a libs works perfectly with Irrlicht 1.2.
So:
- Download latest DirectX SDK from Microsoft site
- decompress the archive in a folder (i.e.: c:\dxsdk_oct06)
- use REIMP (it is included in the MinGW tools in CODE::BLOCKS) to convert d3d9.lib to libd3d9.a
- now add the INCLUDE folder of the DirectX SDK to your compiler directories or directly copy the files in your INCLUDE folder (as you prefer) and add the converted libd3d9.a to your linker options
Now let's configure Irrlicht to compile with DirectX9:
- add -D_IRR_COMPILE_WITH_DIRECT3D_9_ to your linker settings
- open the file IrrCompileConfig.h and comment out the last part of the file:
WARNING: do NOT comment out the #endif located on the last line, just the two above that one.
- now build your new Irrlicht engine!
This way, you will have working Irrlicht.DLL, libIrrlicht.a and libIrrlicht.def with DirectX9 support.
Adding DirectX8 support would be easy, because you'll have just to convert with REIMP the d3d8.lib to libd3d8.a and find suitable includes (in the latest SDK the includes for DX8 seems to be missing... or maybe I haven't found them ?)
This is just to summarize a lot of posts and very good suggestions all around the forums, hope it helps!
PS: and don't forget to keep your installed Directx up to date too
After a few tries I suspected that the Devpak for DevC++ I was using was too old to work with latest DirectX functions, so I tried to use the latest DirectX SDK (in this case, october 2006 release), as HF suggested a few posts above this one.
Since I use Mingw, I have converted the .libs files contained in the SDK to .a files with REIMP (detailed instructions on REIMP in gfxstyler's post HERE).. all worked flawlessly and the new .a libs works perfectly with Irrlicht 1.2.
So:
- Download latest DirectX SDK from Microsoft site
- decompress the archive in a folder (i.e.: c:\dxsdk_oct06)
- use REIMP (it is included in the MinGW tools in CODE::BLOCKS) to convert d3d9.lib to libd3d9.a
- now add the INCLUDE folder of the DirectX SDK to your compiler directories or directly copy the files in your INCLUDE folder (as you prefer) and add the converted libd3d9.a to your linker options
Now let's configure Irrlicht to compile with DirectX9:
- add -D_IRR_COMPILE_WITH_DIRECT3D_9_ to your linker settings
- open the file IrrCompileConfig.h and comment out the last part of the file:
Code: Select all
#ifdef _MSC_VER
#if (_MSC_VER < 1300 && !defined(__GNUC__))
#undef _IRR_COMPILE_WITH_DIRECT3D_9_
#pragma message("Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.")
#endif
#endif
- now build your new Irrlicht engine!
This way, you will have working Irrlicht.DLL, libIrrlicht.a and libIrrlicht.def with DirectX9 support.
Adding DirectX8 support would be easy, because you'll have just to convert with REIMP the d3d8.lib to libd3d8.a and find suitable includes (in the latest SDK the includes for DX8 seems to be missing... or maybe I haven't found them ?)
This is just to summarize a lot of posts and very good suggestions all around the forums, hope it helps!
PS: and don't forget to keep your installed Directx up to date too
-
- Posts: 5
- Joined: Mon Feb 20, 2006 8:41 am
- Contact:
I can't get this to work. The DLL compiles without any errors but my program crashes when I try to use either version of directX (opengl and the software renderers work fine). It tells me that DirectX support was not compiled into the DLL.
I'm using:
CodeBlocks 1.0 Release Candidate 2
Irrlicht 1.2
Microsoft DirectX SDK, October 2006 version
I'm using:
CodeBlocks 1.0 Release Candidate 2
Irrlicht 1.2
Microsoft DirectX SDK, October 2006 version
Yeah, i would like to know how to compile irrlicht 1.2 to allow DX8 and 9 too.I can't get this to work. The DLL compiles without any errors but my program crashes when I try to use either version of directX (opengl and the software renderers work fine). It tells me that DirectX support was not compiled into the DLL.
-
- Posts: 5
- Joined: Mon Feb 20, 2006 8:41 am
- Contact:
I've tried multiple old sdks; i can only get dx9 to work (that wasn't working either when i first posted; don't know what i did wrong but i tried again and it worked). Irrlicht no longer tells me that directx8 support was not compiled into the dll, it just crashes.
As for why Microsoft removed it, it's their policy to dump old versions of their software after a certain amount of time, usually about 4-5 years, i think.
As for why Microsoft removed it, it's their policy to dump old versions of their software after a certain amount of time, usually about 4-5 years, i think.
v1.2 compatible DLL
here is a precompiled DX9/DX8 compatible v1.2 Irrlicht.dll and libIrrlicht.a.
EDIT: i want to reneg. i went back to the old way i was doing DX81 (not the devpak) and it worked! so here is a fully functional (at least in my tests) DX build.
http://www.gprogs.com/irrlicht.mod/IrrDX_v1_2.zip
EDIT: i want to reneg. i went back to the old way i was doing DX81 (not the devpak) and it worked! so here is a fully functional (at least in my tests) DX build.
http://www.gprogs.com/irrlicht.mod/IrrDX_v1_2.zip
Last edited by garrittg on Tue Dec 19, 2006 5:23 pm, edited 1 time in total.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Oh, so it's not only me having problems with DX8? I managed to follow the descriptions of how to use the mingw tools to create .a files, but unfortunately all my versions for DX8 crashed. So does the original version from the old directx devpak from dev-c++ site. Anyone knows why that is?
And thanks for your support garritg! It seems to help people a lot to get a working binary version. Maybe we can get a version with at least DX9 in one of the next releases.
And thanks for your support garritg! It seems to help people a lot to get a working binary version. Maybe we can get a version with at least DX9 in one of the next releases.
greetings hybrid been a while. ive been having DX81 fits since v1.0. after your last post it dawned on my that i hadnt tried the original way i was doing DX81 after i switched to codeblocks for this build. it rebuilt fine and it worked! please redownload the v1.2 DLL distro and give it a whirl.
along those lines, there really is no reason why the stock VC build of Irrlicht could not work in MingW as long as we get the exports right. from my research, i believe we just need to get the exports such that the VC name mangling does not occur. i only have VC6 and VC8Express so i dont have anything that can build a good DLL to try it out.
along those lines, there really is no reason why the stock VC build of Irrlicht could not work in MingW as long as we get the exports right. from my research, i believe we just need to get the exports such that the VC name mangling does not occur. i only have VC6 and VC8Express so i dont have anything that can build a good DLL to try it out.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Ok, using the Irrlicht-VC version with mingw would be another thing, but I am looking for a way to get Irrlicht to compile with DirectX support under mingw (dev-cpp or c::b would not really matter, I usually use the command line tools ). But converting the d3dx8ab.dll did not work, so I only used directX9 now. But for testing under Windows I'd really like to have DX8 as well.
download the following file:
http://www.gprogs.com/irrlicht.mod/DX_81_a_files.zip
that is the required MingW .a file and the DLL for DX81. you will still need the DX81 SDK header files in order for it to work. change the settings of the project to add the DX81 SDK include folder, add the -D for DX8, and then add the lib libd3dx81ab.a to the project. everything should compile at that point.
i could not get the devpak to work at all.
http://www.gprogs.com/irrlicht.mod/DX_81_a_files.zip
that is the required MingW .a file and the DLL for DX81. you will still need the DX81 SDK header files in order for it to work. change the settings of the project to add the DX81 SDK include folder, add the -D for DX8, and then add the lib libd3dx81ab.a to the project. everything should compile at that point.
i could not get the devpak to work at all.