我使用Code :: Blocks为我的Debian构建并安装了Ogre。接下来,我尝试编译教程应用程序但是我收到了这些错误:
obj/Debug/BaseApplication.o: In function `BaseApplication':
/home/ver/projects/testogre/BaseApplication.cpp:34: undefined reference to `Ogre::StringUtil::BLANK'
/home/ver/projects/testogre/BaseApplication.cpp:34: undefined reference to `Ogre::StringUtil::BLANK'
obj/Debug/BaseApplication.o: In function `~BaseApplication':
/home/ver/projects/testogre/BaseApplication.cpp:45: undefined reference to `Ogre::WindowEventUtilities::removeWindowEventListener(Ogre::RenderWindow*, Ogre::WindowEventListener*)'
/home/ver/projects/testogre/BaseApplication.cpp:47: undefined reference to `Ogre::Root::~Root()'
obj/Debug/BaseApplication.o: In function `BaseApplication::configure()':
/home/ver/projects/testogre/BaseApplication.cpp:56: undefined reference to `Ogre::Root::showConfigDialog()'
/home/ver/projects/testogre/BaseApplication.cpp:60: undefined reference to `Ogre::StringUtil::BLANK'
/home/ver/projects/testogre/BaseApplication.cpp:60: undefined reference to `Ogre::Root::initialise(bool, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
obj/Debug/BaseApplication.o: In function `BaseApplication::chooseSceneManager()':
/home/ver/projects/testogre/BaseApplication.cpp:73: undefined reference to `Ogre::StringUtil::BLANK'
/home/ver/projects/testogre/BaseApplication.cpp:73: undefined reference to `Ogre::Root::createSceneManager(unsigned short, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
我添加了/ usr / local / include / OGRE和/ usr / local / lib / OGRE,但这没有帮助。 =(
答案 0 :(得分:2)
编译时,必须将OgreMain库链接到可执行文件。