问题
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 to
XFree'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|170|undefined reference toglXMakeContextCurrent'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|175|undefined reference to
glXMakeCurrent'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|178|undefined reference toglXDestroyContext'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|180|undefined reference to
glXDestroyWindow'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|192|undefined reference toXDestroyWindow'| /home/shar/irrlicht-1.8.3/source/Irrlicht/CIrrDeviceLinux.cpp|193|undefined reference to
XCloseDisplay'|
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