I’m beginner in ogre3D and I’m build mi first program in Ogre3D, but when I try to compile the program I get this error:
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&)'
And Continue the fix
- I Compile the program manually:
gcc test.cpp -o test.o test
And my file test is this:
#include <Ogre.h>
using namespace Ogre;
int main()
{
Root* root= new Root();
if( !root->restoreConfig() )
{
root->showConfigDialog();
root->saveConfig();
}
return 0;
}
How to fix my problem?
I’m use Debian Wheezy.
The Version Ogre3D: 1.8
Thanks for your answers.
This is a linker error.
Use
pkg-config --libsto retrieve the correct linker optionsIf you have installed OGRE in a nonstandard location (say
/opt/ogre), you may need to call pkg-config with thePKG_CONFIG_PATHenvironment variable set: