Linker fails to find headers in /usr/local/include/OGRE

Problems building or running the engine, queries about how to use features etc.
Post Reply
IAmVeryLost
Gnoblar
Posts: 2
Joined: Mon Mar 01, 2021 12:07 pm

Linker fails to find headers in /usr/local/include/OGRE

Post by IAmVeryLost »

Ogre Version: 1.12.11 (from github master)
Operating System: Linux (Ubuntu)
Render System: None/not relevant

When attempting to compile bootstrap.cpp (https://github.com/OGRECave/ogre/blob/m ... tstrap.cpp) I get thrown error:

Code: Select all

bootstrap.cpp:1:10: fatal error: Ogre.h: No such file or directory
Despite the fact that I have fully installed OGRE into usr/local/ as instructed. Trying to manually link the headers leads to library linking headers that I can't seem to fix as supplying -l<Library without .so ending> throws library not found. I did this by doing:

Code: Select all

g++ -I /usr/local/include/OGRE/ -I /usr/local/include/OGRE/Bites/ -I /usr/local/include/OGRE/RTShaderSystem/ -L/usr/local/lib/OGRE/ bootstrap.cpp
This then throws a number of missing lib linker errors such as:

Code: Select all

/usr/bin/ld: /tmp/ccDc3bb1.o:(.data.rel.ro._ZTIN4Ogre21ItemIdentityExceptionE[_ZTIN4Ogre21ItemIdentityExceptionE]+0x10): undefined reference to `typeinfo for Ogre::Exception'
Supplying -lRenderSystem_GL throws:

Code: Select all

/usr/bin/ld: cannot find -lRenderSystem_GL
Is there any way to make it correctly link all the headers including those in subfolders and all the libs?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Linker fails to find headers in /usr/local/include/OGRE

Post by paroj »

the easiest would be to just use CMake for this:
https://github.com/OGRECave/ogre/blob/m ... eLists.txt

but if you insist on not doing so, the exception is defined in

Code: Select all

-lOgreMain
-lRenderSystem_GL does not work because it is a plugin that is loaded at runtime:
https://ogrecave.github.io/ogre/api/lat ... otoc_md291
IAmVeryLost
Gnoblar
Posts: 2
Joined: Mon Mar 01, 2021 12:07 pm

Re: Linker fails to find headers in /usr/local/include/OGRE

Post by IAmVeryLost »

paroj wrote: Mon Mar 01, 2021 1:37 pm the easiest would be to just use CMake for this:
https://github.com/OGRECave/ogre/blob/m ... eLists.txt

but if you insist on not doing so, the exception is defined in

Code: Select all

-lOgreMain
-lRenderSystem_GL does not work because it is a plugin that is loaded at runtime:
https://ogrecave.github.io/ogre/api/lat ... otoc_md291
The CMake file worked perfectly, thank you! When is it worth regenerating the CMake?
Post Reply