My Irrlicht program doesn't link. The compiler I use is g++.
Code:
#include <irrlicht.h>
int main()
{
irr::IrrlichtDevice *device = irr::createDevice();
// And other init stuff
while(device->run())
{
driver->beginScene();
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
}
Linker output:
...
(path)/main.cpp:28: undefined reference to `__imp_createDevice'
collect2.exe: error: ld returned 1 exit status
Command line:
g++.exe -o "(Path)\Test.exe" "(Path)\Test\main.o"
..\..\..\..\..\..\MinGW\lib\libIrrlicht.a
The linker founds the library file. What's wrong?
Edit:
I made little experimenting. The result was, that when I comment createDevice()
-line out, no linker errors will come. So that means, that linker founds all the other functions, i.e. IrrlichtDevice::run()
.