irrlicht : undefined reference to `XFree'

淺唱寂寞╮ 提交于 2019-12-12 03:32:38

问题


i using code::blocks and irrlicht but when i run my code i get a list of errors i don't know why my code are right and i use the version 1.8.3 from the lib and i definded it in the code::blocks options

||=== Build: Debug in shit2 (compiler: GNU GCC Compiler) ===| ../../irrlicht-1.8.3/source/Irrlicht/libIrrlicht.a(CIrrDeviceLinux.o)||In function irr::CIrrDeviceLinux::~CIrrDeviceLinux()':| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|138|undefined reference toXFree'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|170|undefined reference to glXMakeContextCurrent'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|175|undefined reference toglXMakeCurrent'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|178|undefined reference to glXDestroyContext'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|180|undefined reference toglXDestroyWindow'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|192|undefined reference to XDestroyWindow'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|193|undefined reference toXCloseDisplay'|

that's my code

#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace video;

int main()
{
    IrrlichtDevice* device = createDevice(EDT_OPENGL);
    if(!device) return 1;
    IVideoDriver* driver = device->getVideoDriver();
    scene::ISceneManager* smgr = device->getSceneManager();
    gui::IGUIEnvironment* guienv = device->getGUIEnvironment();
    guienv->addStaticText(L"hello shit", recti(10, 10, 100, 30));
    while(device->run())
    {

        driver->beginScene(true, true, SColor(255, 190, 190, 250));
        smgr->drawAll();
        guienv->drawAll();
        driver->endScene();

    }
    device->drop();
}

来源:https://stackoverflow.com/questions/36066372/irrlicht-undefined-reference-to-xfree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!