Compile Irrlicht with Mingw and both DirectX 9 & 8?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
SLC
Posts: 21
Joined: Mon Jan 06, 2014 9:41 pm

Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by SLC »

Hi, I'm trying to build Irrlicht with both DirectX 9 and 8 however I'm stuck at this error message:

Code: Select all

 
..\tmp\obj\win32\external\irrlicht\CIrrDeviceWin32.o:CIrrDeviceWin32.cpp|| undefined reference to `IID_IDirectInput8A'|
..\tmp\obj\win32\external\irrlicht\CIrrDeviceWin32.o:CIrrDeviceWin32.cpp|| undefined reference to `IID_IDirectInput8A'|
 
I have both DirectX 8 and 9 libraries and include files. I've downloaded the DirectX 8 SDK from here www.darwinbots.com/numsgil/dx81sdk_full.exe and the DirectX 9 SDK from the official Microsoft website DXSDK_Jun10.exe. I admit that I haven't installed them properly because I don't need all that crap in my computer so I've opened the installation with 7-zip and just extracted the include and lib folders and pointed my Code::Blocks project to those folders.

From the error message there seems to be a problem with the input libraries from the DirectX package (dinput8 and dinput) however I can't seem to figure out what the problem is and The internet isn't helping me too much since MS decided DirectX 8 should suffer the same fate as the dinosaurs. I think I'll try to compile with NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ and see if that gives any results.

I've tried every possible way:
  • I've used the full path to libraries insdead of just the name in my Code::Blocks project.
  • I've converted the .lib's to .a using gfxstyler's method. (I've also tried to link to the .lib files)
  • I've linked not just to d3dx9 and d3d8 but to every library from both the DirectX versions.
If anyone of you still have the DirectX 8 libraries or the corresponding SDK then please share them with me.

Used tools are:
Latest Irrlicht from the SVN (1.9 with the latest commits in 2014)
Code::Blocks 13.12 (latest stable version)
GCC 4.8.1 x86 (using the MinGW from nuwen.net)
Windows XP SP3 x86 Professional (for compatibility reasons)

Thank you for your time and I'm waiting for your answers :)
SLC
Posts: 21
Joined: Mon Jan 06, 2014 9:41 pm

Re: Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by SLC »

Apparently compiling with NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ solves the issues and the application is able to run with both DirectX 8 and 9 however if anyone has an answer as to why this error occurred and how can I get to compile with DirectInput then please share it :)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by CuteAlien »

For some reason DirectInput forces you to link to dinput8.lib. Don't know why that is the case just for DirectInput and not the other DirectX libraries. You find that lib in your DirectX SDK under the Lib folder usually.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
SLC
Posts: 21
Joined: Mon Jan 06, 2014 9:41 pm

Re: Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by SLC »

I already tried that and still the same result. I've tried with both .lib and the .a (using gfxstyler's method) I've tried with both versions of dinput8.lib from Direct X 8 and 9. I've tried to link to every .lib file in the SDK but still the same result. The only thing that allows me to compile it is to disable DirectInput using NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_. Other than that nothing works. I read here The future of the DirectX.DevPak for Dev-Cpp that DirectInput has issues when compiling with MinGW. Should I compile Irrlicht using the DevPacks? They haven't been updated in a while and I don't like old bugged code since a use a new compiler.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by CuteAlien »

Hm, no idea then. Maybe DirectInput just doesn't work with MinGW. But we're probably going to kick-out dx8 soon anyway.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by hybrid »

Well, you don't need the directinput joystick, we have other joystick methods under Windows as well. So should still work.
Asimov
Posts: 246
Joined: Thu Dec 04, 2014 7:41 pm
Contact:

Re: Compile Irrlicht with Mingw and both DirectX 9 & 8?

Post by Asimov »

Hi SLC,

Did you ever manage to get it to compile?
I am only asking because I am using code::blocks and mingw gcc, and I have no idea where to start.
I am in no great hurry mind. I got openGL to work, but strangely I have always preferred directx.

I could use visual studio, but I have just upgraded from vs 2010 to vs 2012 and I hate the interface.

Asimov
Post Reply