Page 1 of 1

compile against Irrlicht.dll produces loads of errors

Posted: Tue Oct 10, 2006 7:00 pm
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

Posted: Tue Oct 10, 2006 7:03 pm
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

Posted: Tue Oct 10, 2006 7:16 pm
by Tanuva
:oops: Argh, now that you said it... What a glorious idea, let's include binary data in a source file... :roll: :lol:

Posted: Wed Oct 11, 2006 1:06 pm
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? ^^

Posted: Wed Oct 11, 2006 1:08 pm
by saulotmalo
have you put the .a file path?? i think this could be the problem...

Posted: Wed Oct 11, 2006 1:35 pm
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 ;) )

Posted: Wed Oct 11, 2006 4:59 pm
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

Posted: Wed Oct 11, 2006 5:26 pm
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?

Posted: Wed Oct 11, 2006 6:24 pm
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.

Posted: Wed Oct 11, 2006 6:45 pm
by Tanuva
I already read that thread, but it didn't seem to be the same problem as here... I'll try :)

Posted: Wed Oct 11, 2006 8:06 pm
by Tanuva
Why have I tried it so complicated?! Just got the Irrlicht DevPak (although ver 1.0) and it simply works...