Domanda

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)
È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top