Page 1 of 1

MinGW woes

Posted: Mon Nov 13, 2006 3:43 pm
by gavicus
I'm getting a load of compile errors when trying to compile Irrlicht with MinGW Developer Studio 2.05 for the first time. I've trimmed my code down to bare bones...

#include <irrlicht.h>
int main()
{
return 0;
}

...and with just that, I get 7 errors and 59 warnings. It looks like its all about the #include<irrlicht.h> line. I won't include the whole list of entries, but here's an example:

In file included from ..\..\..\irrlicht-1.0\include\irrlicht.h:36,
from main.cpp:1:
..\..\..\irrlicht-1.0\include\SLight.h: In constructor `irr::video::SLight::SLight()':
..\..\..\irrlicht-1.0\include\SLight.h:57: warning: `irr::video::SLight::Type' will be initialized after
..\..\..\irrlicht-1.0\include\SLight.h:37: warning: `irr::video::SColorf irr::video::SLight::AmbientColor'
..\..\..\irrlicht-1.0\include\SLight.h:34: warning: when initialized here

I'm not sure what's going on here. Has anyone gotten the same problems?

Posted: Mon Nov 13, 2006 4:24 pm
by hybrid
You have to add -Wno-reorder to the compiler flags to suppress these warnings. They don't really matter so they are not fixed.

Posted: Mon Nov 13, 2006 5:18 pm
by gavicus
Ok, this gets me down to one error message Now when I try the line:

IrrlichtDevice *device = createDevice(driverType, core::dimension2d<s32>(640, 480));

I get the error:

C:\cpp\test\main.cpp:36: undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'

I'm sure this is just IDE setup, and I'm unfamiliar with MinGW. Any ideas?

Posted: Mon Nov 13, 2006 6:17 pm
by KillerXX7
You have forgotten to add irrlicht.lib ?

#pragma comment(lib,"irrlicht.lib")

Posted: Mon Nov 13, 2006 7:26 pm
by gavicus
Nope, I have the

#pragma comment(lib, "Irrlicht.lib")

line coded in. The above code is a result of gradual trimming down until practically nothing is left. Before I removed the pragma comment, I already had the error.

At this point, it compiles fine until I try the createDevice command.

Anyway, its enfuriating because I have done all this with visual studio, but don't have access to it anymore.

Posted: Mon Nov 13, 2006 7:33 pm
by sio2
some pragma's are compiler specific, I believe. Does MinGW support that?

If it does support it, does the linker have the path to the irrlicht lib?

Posted: Mon Nov 13, 2006 7:36 pm
by sio2
gavicus wrote: Anyway, its enfuriating because I have done all this with visual studio, but don't have access to it anymore.
I don't know if this is any help, but have you tried Visual Studio 2005 Express? It's free, I believe.