Command line compile in win, using gcc from minGW?

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
Rusk
Posts: 7
Joined: Fri Feb 03, 2012 1:51 am

Command line compile in win, using gcc from minGW?

Post by Rusk »

Hey, it's been six months and a new hard drive since I did any programming... so I'm kind of starting over from scratch. I decided to skip code::blocks this time and try a bare bones approach, just for fun. I've hit a dead end already though, trying to get the first tutorial to compile.

I am using windows 7, the latest stable irrlicht, 1.8, and mingw with gcc version 4.6.2. I am compiling the first tutorial and get errors:

Code: Select all

g++ -Wall -ID:\Opt\irrlicht-1.8\include -LD:\Opt\irrlicht-1.8\lib\Win32-gcc sub.cpp libIrrlicht.a -o sub.exe
 
sub.cpp: In function 'int main()':
sub.cpp:13:5: error: 'IrrlichDevice' was not declared in this scope
sub.cpp:13:20: error: 'device' was not declared in this scope
sub.cpp:20:5: error: 'IVideoDrive' was not declared in this scope
sub.cpp:20:19: error: 'driver' was not declared in this scope
sub.cpp:40:65: error: 'sColor' was not declared in this scope
mingw32-make: *** [sub.exe] Error 1
I guess I don't know how to specify the library. The paths should be right since it finds the header. I've tried swapping places of "sub.cpp" and "libIrrlicht.a" although I think the libraries should be after the file(?), also replacing "libIrrlicht.a" with "-lIrrlicht" (according to http://www.network-theory.co.uk/docs/gc ... ro_17.html). There must be something else I'm missing... any hints? :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Command line compile in win, using gcc from minGW?

Post by hybrid »

These are compile time errors, so your code is simply wrong. IVideoDriver is missing the last 'r' and IrrlichtDevice the 't' in the center. Maybe go back to an IDE which would tell you directly such things...
And yes, -lIrrlicht is better and has to go after all .cpp and .o files mentioned
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Command line compile in win, using gcc from minGW?

Post by CuteAlien »

Also sColor is SColor.
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
Rusk
Posts: 7
Joined: Fri Feb 03, 2012 1:51 am

Re: Command line compile in win, using gcc from minGW?

Post by Rusk »

You are right, there were a lot of spelling errors there. :oops:
Post Reply