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
OIS GCC Compiler error
-
03-06-2022 - |
Pergunta
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)
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow