compile against Irrlicht.dll produces loads of errors

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
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

compile against Irrlicht.dll produces loads of errors

Post by Tanuva »

Hi,
I'm just trying to compile Irrlicht against the gcc-Irrlicht.dll, but gcc produces loads of errors like this:

Code: Select all

Irrlicht.dll:7: stray ´\377´ in program
Irrlicht.dll:7: stray ´\320´ in program
Irrlicht.dll:7: stray ´\215´ in program
There are tons of such lines for each line in the DLL and there are some other errors between them like "warning: null character(s) ignored".

My code comes here, nothing special yet, I'm just trying to get it to compile correctly atm:

Code: Select all

 
#include <iostream>
//#include <string.h>
#include "Irrlicht.dll"
 
using namespace std;

int Main(int argc, char **argv)
{
	cout << "kabumm!";
}
The Irrlicht.dll is in the same directory like the code.

How do I get gcc to compile this correctly? Oo
Tanuva
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

OMG, you do not include a shared library/dll into your source. Have a look at the examples. They should compile/link/run on your system. Just use them as a template.

Travis
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

:oops: Argh, now that you said it... What a glorious idea, let's include binary data in a source file... :roll: :lol:
Tanuva
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

Okay, here's the next try. Set devcpp up like described in the tutorial, but compiling it... The linker gives this error message:

Code: Select all

  [Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc' 
This is my source:

Code: Select all

#include <cstdlib>
#include <iostream>
#include "irrlicht.h"

using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace gui;
using namespace io;

int main(int argc, char *argv[])
{
    IrrlichtDevice *device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 32, false, false, false, 0);

    cout << "kabumm!\n";    // just for seeing it works
    cin.get();
    return 0;
}
What may be wrong this time? It's like in the tutorial... maybe it changed since 0.3? ^^
Tanuva
saulotmalo
Posts: 54
Joined: Wed Oct 04, 2006 6:56 am

Post by saulotmalo »

have you put the .a file path?? i think this could be the problem...
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

I've added the path to the libIrrlicht.a to Compiler Options/Directories/Libraries, but it's located in the source folder anyway...

(In german the dialog where I entered the lib path is named "Compiler Optionen/Verzeichnisse/Bibliotheken", I translated the labels on the fly ;) )
Tanuva
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It looks like you're linking to the wrong lib file. You want to make sure you're linking against the one that is made for your compiler. It looks like you are using Win32-gcc, so make sure you are linking to the library that is in that directory.

Travis
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

I'm using the .a file from irrlicht-1.1/lib/Win32-gcc and the dll from bin/Win32-gcc, these should be the right ones, shouldn't they?
Tanuva
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Should be. I don't use GCC, so I don't know. If you do a search or look at the FAQ, you'll see that this problem has come up several times and linking to the other library is the solution.
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

I already read that thread, but it didn't seem to be the same problem as here... I'll try :)
Tanuva
Tanuva
Posts: 54
Joined: Tue Oct 10, 2006 6:49 pm
Location: 200 metres behind the moon
Contact:

Post by Tanuva »

Why have I tried it so complicated?! Just got the Irrlicht DevPak (although ver 1.0) and it simply works...
Tanuva
Post Reply