我是 ogre3D 的初学者,我正在 Ogre3D 中构建 mi 第一个程序,但是当我尝试编译程序时出现此错误:
In function `main':
test.cpp:(.text+0x14): undefined reference to `std::allocator<char>::allocator()'
test.cpp:(.text+0x30): undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char const*,
std::allocator<char> const&)'
test.cpp:(.text+0x40): undefined reference to `std::allocator<char>::allocator()'
test.cpp:(.text+0x5c): undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char const*,
std::allocator<char> const&)'
test.cpp:(.text+0x6c): undefined reference to `std::allocator<char>::allocator()'
test.cpp:(.text+0x88): undefined reference to `std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char const*,
std::allocator<char> const&)'
并继续修复
- 我手动编译程序:
gcc test.cpp -o test.o test
我的文件测试是这样的:
#include <Ogre.h>
using namespace Ogre;
int main()
{
Root* root= new Root();
if( !root->restoreConfig() )
{
root->showConfigDialog();
root->saveConfig();
}
return 0;
}
如何解决我的问题?
我正在使用 Debian Wheezy。
Ogre3D 版本:1.8
感谢您的回答。