c++ - 编译 OGRE 教程示例时出现问题。

标签 c++ linux codeblocks ogre

我已经使用 Code::Blocks 构建 Ogre 并将其安装到我的 Debian 中。接下来,我尝试编译教程应用程序,但出现以下错误:

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 但这没有帮助。 =(

最佳答案

当您编译时,您必须将 OgreMain 库链接到您的可执行文件。

关于c++ - 编译 OGRE 教程示例时出现问题。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7671780/

相关文章:

c++ - boost::作为友元类的变体

.net - pkg-config 如何决定默认添加哪个查找路径?

linux - 如何通过 ssh 进入远程服务器,运行命令并留在服务器上

c - 在 CodeBlocks 中运行 ffmpeg 示例 c 程序时无法识别文件格式

c++ - 自定义类ostringstream输出错误

c++ - keybd_event() 调用不发送到远程桌面

c++ - 为什么分配堆内存比分配栈内存快得多?

linux - SSSD 和 sudo : mismatch between sudoHost and server hostname

C++ 程序已停止工作 LINK LIST