日期:2014-05-16  浏览次数:20613 次

编译问题,紧急求助!!!
我在用g++编译一个项目时,一直报下面这样的错误,不知道是怎么回事?哪位大侠能指点一下,原因在哪?


Activity.o: In function `Activity::process_output()':
Activity.cpp:(.text+0x7ae): undefined reference to `typeinfo for pbe::UnknownException'
Activity.o: In function `pbe::ErrnoException::ErrnoException(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)':
Activity.cpp:(.text._ZN3pbe14ErrnoExceptionC2ESsi[_ZN3pbe14ErrnoExceptionC5ESsi]+0x29): undefined reference to `vtable for pbe::ErrnoException'
Activity.o: In function `pbe::ErrnoException::~ErrnoException()':
Activity.cpp:(.text._ZN3pbe14ErrnoExceptionD2Ev[_ZN3pbe14ErrnoExceptionD5Ev]+0x16): undefined reference to `vtable for pbe::ErrnoException'
Activity.o: In function `pbe::ErrnoException::ErrnoException(pbe::ErrnoException const&)':
Activity.cpp:(.text._ZN3pbe14ErrnoExceptionC2ERKS0_[_ZN3pbe14ErrnoExceptionC5ERKS0_]+0x2d): undefined reference to `vtable for pbe::ErrnoException'
Activity.o: In function `pbe::throw_ErrnoException(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)':
Activity.cpp:(.text._ZN3pbe20throw_ErrnoExceptionESsi[pbe::throw_ErrnoException(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)]+0xa50): undefined reference to `typeinfo for pbe::ErrnoException'
Activity.o: In function `pbe::UnknownException::UnknownException()':
Activity.cpp:(.text._ZN3pbe16UnknownExceptionC2Ev[_ZN3pbe16UnknownExceptionC5Ev]+0x1f): undefined reference to `vtable for pbe::UnknownException'
Activity.o: In function `pbe::UnknownException::~UnknownException()':
Activity.cpp:(.text._ZN3pbe16UnknownExceptionD2Ev[_ZN3pbe16UnknownExceptionD5Ev]+0x13): undefined reference to `vtable for pbe::UnknownException'
Activity.o:(.rodata._ZTVN3pbe7NoSpaceE[vtable for pbe::NoSpace]+0x20): undefined reference to `pbe::ErrnoException::report(std::basic_ostream<char, std::char_traits<char> >&) const'
Activity.o:(.rodata._ZTVN3pbe18InterruptedSysCallE[vtable for pbe::Interrupte

------解决方案--------------------
貌似是peb这个库有问题
------解决方案--------------------
一定是链接库问题。 也许要extern "C"?