Fatal Error: OgreCgPlugin.h: No Such File or Directory (Ogre3d)

2.1k views Asked by At

After attempting to install Ogre3d from source for Linux, it all built properly but I realized that I had built static libraries. I re-built using CMake again, this time un-ticking the static option. When I create a new Ogre Project in code::blocks and try to compile, I get:

 __________________________________________________ ____ _________________________________________________________
| /usr/local/include/OGRE/OgreStaticPluginLoader.h | 28 | fatal error: OgreCgPlugin.h: No such file or directory |
|__________________________________________________|____|________________________________________________________|

I got this error with both the static and dynamic builds of Ogre3d. Note that I did not change any settings after creating the project, just clicked compile. Can anyone help me?

1

There are 1 answers

5
Jeremy Sandell On BEST ANSWER

It almost sounds like when you recompiled (after unchecking static), it didn't install the files afterward, as at some time during the build process it generates a file called OgreBuildSettings.h that holds this information (in this case, it's defining OGRE_STATIC_LIB, despite the fact that you unchecked it.)

If you ran cmake directly from the Ogre repository directory, I'd recommend checking out a clean copy of the Ogre source and rebuilding.

One thing that might be helpful - generally when I'm building it, I'll follow a pattern along the lines of:

cd /path/to/ogre; mkdir build && cd build && cmake-gui .. && make && sudo make install

This has the benefit of keeping my build configuration separate from the source, lets me have separate build directories for dynamic and static builds, and (most importantly) allows me to just remove the build directory and start over quickly, in the event that I screwed something up. (: