I am a beginner in programming and compiling C++. I am currently trying to build a very basic OGRE application on OSX (10.10) using g++ compiler and makefile. My makefile is based on the one provided on cleversoap's github repository. I am also using a prebuilt version of the SDK for OSX.
When I first tried to build the tutorial framework from the OGRE 3D webiste, I ended up with multiple linking errors related to the Ogre objects and functions definitions. I edited the source file leaving only those few lines of code.
#include <OgreRoot.h>
#include <OgreCamera.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreLogManager.h>
#include <OgreViewport.h>
#include <OgreEntity.h>
#include <OgreWindowEventUtilities.h>
#include <OgrePlugin.h>
int main() {
Ogre::Root* mRoot;
mRoot = new Ogre::Root("", "", "LowLevelOgre.log");
delete mRoot;
}
My compile command resulting of the makefile looks like this:
g++ LowLevelOgre.cpp -o OgreMake.app/Contents/MacOS/OgreMake -arch i386 -I/Developer/SDKs/OgreSDK/include/OGRE -I/Developer/SDKs/OgreSDK/include/OGRE/OSX -I/Developer/SDKs/OgreSDK/include/OIS -I/Developer/SDKs/OgreSDK/boost -L/Developer/SDKs/OgreSDK/lib/release -lOIS -F/System/Library/Frameworks -F/Library/Frameworks -framework Carbon -framework AppKit -framework Foundation -framework IOKit -F/Developer/SDKs/OgreSDK/lib/release -framework Cg -framework Ogre
Even though the linker does not complain about the Ogre.framework, I get this error basically meaning that the Ogre::Root definition is missing. (At least I think)
Undefined symbols for architecture x86_64:
"Ogre::Root::Root(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-3183b9.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1
I cannot seem to find what is causing this linking error. Is there anything I am missing or I may have misunderstood?