Irrlicht - error LNK2001: unresolved external symbol

718 Views Asked by At

I have a problem compiling the Irrlicht hello_world example. I configured my visual studio project for all configurations :

  • Configuration Properties -> VC++ Directories -> Include Directories : C:\irrlicht-1.8.1\include
  • Configuration Properties -> VC++ Directories -> Library Directories : C:\irrlicht-1.8.1\lib\Win32-visualstudio
  • Configuration Properties -> Linker -> Input -> Additional dependencies : Irrlicht.lib;Irrlicht.exp

I use Windows 64 bits with Visual studio premium 2013.

Code

#include <irrlicht.h>

using namespace irr;

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

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif


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

    if (!device)
        return 1;

    device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();
    IGUIEnvironment* guienv = device->getGUIEnvironment();

    guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
        rect<s32>(10,10,260,22), true);

    IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
    if (!mesh)
    {
        device->drop();
        return 1;
    }
    IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

    if (node)
    {
        node->setMaterialFlag(EMF_LIGHTING, false);
        node->setMD2Animation(scene::EMAT_STAND);
        node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
    }

    smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));

    while(device->run())
    {
        driver->beginScene(true, true, SColor(255,100,101,140));

        smgr->drawAll();
        guienv->drawAll();

        driver->endScene();
    }
    device->drop();

    return 0;
}

Error

1>------ Build started: Project: Test, Configuration: Release Win32 ------
1>  main.cpp
1>Irrlicht.exp : error LNK2001: unresolved external symbol "class irr::video::SMaterial irr::video::IdentityMaterial" (?IdentityMaterial@video@irr@@3VSMaterial@12@A)
1>Irrlicht.exp : error LNK2001: unresolved external symbol "class irr::core::CMatrix4<float> const irr::core::IdentityMatrix" (?IdentityMatrix@core@irr@@3V?$CMatrix4@M@12@B)
1>Irrlicht.exp : error LNK2001: unresolved external symbol "class irr::core::string<char,class irr::core::irrAllocator<char> > irr::core::LOCALE_DECIMAL_POINTS" (?LOCALE_DECIMAL_POINTS@core@irr@@3V?$string@DV?$irrAllocator@D@core@irr@@@12@A)
1>C:\Users\Leaf\Documents\Visual Studio 2013\Projects\Test\Release\Test.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
0

There are 0 best solutions below