문제

im trying to compile a simple Ogre3d application using OIS; i override the function like so:

virtual bool keyPressed(const OIS::KeyEvent& arg);

However, i get linker errors like this:

CMakeFiles/thorium.dir/Application/Application.cpp.o:(.rodata._ZTVN7Thorium11ApplicationE[_ZTVN7Thorium11ApplicationE]+0x48): undefined reference to `Thorium::Application::keyPressed(OIS::KeyEvent const&)'

Ive added the library to my cmake as well as tried using a shared library but it also did not work. Im using the ois package and therefore havent compiled myself.

target_link_libraries(... OgreMain OIS.a)
도움이 되었습니까?

해결책

Undefined reference error often occures when the library code not loaded. Put libNAME.a file in lib searching path and compile modules with key -lNAME

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top