0

I tried to fix this problem but I didn't know what's making this problem.

Here's the code: I'm using irrlicht 3d engine library.


#include <irrlicht.h>

using namespace irr;
using namespace core;
using namespace video;
using namespace scene;


int main()
{
    IrrlichtDevice* device = createDevice(EDT_OPENGL , dimension2d<u32>(640,480) ,16 ,false ,false ,false ,0);

    if (!device)
        return 1;

    video::IVideoDriver * driver = device ->getVideoDriver();

    while (device ->run())
    {
        driver ->beginScene(true , true , SColor(255, 200, 255, 200));
        driver ->endScene();
    }

    device -> drop();
    return 0;
}


And the output is like this:

||=== Build: Debug in Test (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Users\zmajd\Documents\CodeBlock\Test\main.cpp|12|undefined reference to `__imp_createDevice'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
_______________________________________________________________

Also there's a similar question like this , but I didn't understand what he is mean "Link" exactly! Here's the Page: C++ Irrlicht Program doesn't link: "undefined reference to `__imp_createDevice'"

Can you help me please , pls clear answer! thanks

user4581301
  • 31,330
  • 6
  • 30
  • 51
  • to link with GCC: add `-l` to the command line. Your IDE may have a special dialog page to do this for you. [Supplementary reading](https://stackoverflow.com/questions/6264249/how-does-the-compilation-linking-process-work) – user4581301 Jun 14 '21 at 21:53

0 Answers0