flagOnSpawn compile error

Questions or HOWTOs about the above? Post 'em here...
Post Reply
mdskpr
Private First Class
Private First Class
Posts: 95
Joined: Sat Jan 28, 2006 4:17 pm

flagOnSpawn compile error

Post by mdskpr »

Im running linux x86_64 I copeid bzfsAPI.h from bzflag-2.0.12/include to the directory of flagOnSpawn/ and then did 'gcc flagOnSpawn.cpp' and got this error :

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/cc3N5rVd.o: In function `FlagOnSpawnHandler::process(bz_EventData*)':
flagOnSpawn.cpp:(.text+0x9f): undefined reference to `bz_getPlayerByIndex(int)'
flagOnSpawn.cpp:(.text+0xce): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
flagOnSpawn.cpp:(.text+0xf2): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
flagOnSpawn.cpp:(.text+0x102): undefined reference to `bz_givePlayerFlag(int, char const*, bool)'
flagOnSpawn.cpp:(.text+0x147): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text+0x150): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
flagOnSpawn.cpp:(.text+0x167): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text+0x185): undefined reference to `bz_sendTextMessage(int, int, char const*)'
flagOnSpawn.cpp:(.text+0x18e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text+0x1a1): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text+0x1bd): undefined reference to `bz_debugMessage(int, char const*)'
flagOnSpawn.cpp:(.text+0x1c6): undefined reference to `bz_freePlayerRecord(bz_PlayerRecord*)'
/tmp/cc3N5rVd.o: In function `bz_Unload':
flagOnSpawn.cpp:(.text+0x1e1): undefined reference to `bz_removeEvent(bz_eEventType, bz_EventHandler*)'
flagOnSpawn.cpp:(.text+0x1f0): undefined reference to `bz_debugMessage(int, char const*)'
/tmp/cc3N5rVd.o: In function `bz_Load':
flagOnSpawn.cpp:(.text+0x217): undefined reference to `bz_debugMessage(int, char const*)'
flagOnSpawn.cpp:(.text+0x226): undefined reference to `bz_registerEvent(bz_eEventType, bz_EventHandler*)'
flagOnSpawn.cpp:(.text+0x22f): undefined reference to `std::allocator<char>::allocator()'
flagOnSpawn.cpp:(.text+0x240): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
flagOnSpawn.cpp:(.text+0x249): undefined reference to `std::allocator<char>::~allocator()'
flagOnSpawn.cpp:(.text+0x262): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'
flagOnSpawn.cpp:(.text+0x27f): undefined reference to `std::allocator<char>::~allocator()'
flagOnSpawn.cpp:(.text+0x300): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'
flagOnSpawn.cpp:(.text+0x339): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'
flagOnSpawn.cpp:(.text+0x34f): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'
flagOnSpawn.cpp:(.text+0x3ab): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'
flagOnSpawn.cpp:(.text+0x3c9): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
flagOnSpawn.cpp:(.text+0x53b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
flagOnSpawn.cpp:(.text+0x5d1): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
flagOnSpawn.cpp:(.text+0x65f): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
flagOnSpawn.cpp:(.text+0x6a3): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
flagOnSpawn.cpp:(.text+0x6e7): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
/tmp/cc3N5rVd.o:flagOnSpawn.cpp:(.text+0x72b): more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)' follow
/tmp/cc3N5rVd.o: In function `bz_Load':
flagOnSpawn.cpp:(.text+0x1278): undefined reference to `bz_debugMessage(int, char const*)'
flagOnSpawn.cpp:(.text+0x129e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
flagOnSpawn.cpp:(.text+0x12bc): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
flagOnSpawn.cpp:(.text+0x12d3): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text+0x12f2): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/cc3N5rVd.o: In function `bz_EventHandler::~bz_EventHandler()':
flagOnSpawn.cpp:(.text._ZN15bz_EventHandlerD2Ev[bz_EventHandler::~bz_EventHandler()]+0x26): undefined reference to `operator delete(void*)'
/tmp/cc3N5rVd.o: In function `FlagOnSpawnHandler::~FlagOnSpawnHandler()':
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD0Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0x4e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD0Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0xc3): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD0Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0x10b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD0Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0x158): undefined reference to `operator delete(void*)'
/tmp/cc3N5rVd.o: In function `FlagOnSpawnHandler::FlagOnSpawnHandler()':
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerC1Ev[FlagOnSpawnHandler::FlagOnSpawnHandler()]+0x45): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerC1Ev[FlagOnSpawnHandler::FlagOnSpawnHandler()]+0xb6): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerC1Ev[FlagOnSpawnHandler::FlagOnSpawnHandler()]+0xce): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerC1Ev[FlagOnSpawnHandler::FlagOnSpawnHandler()]+0x126): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerC1Ev[FlagOnSpawnHandler::FlagOnSpawnHandler()]+0x171): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/cc3N5rVd.o: In function `bz_EventHandler::~bz_EventHandler()':
flagOnSpawn.cpp:(.text._ZN15bz_EventHandlerD0Ev[bz_EventHandler::~bz_EventHandler()]+0x26): undefined reference to `operator delete(void*)'
/tmp/cc3N5rVd.o: In function `bz_EventHandler::~bz_EventHandler()':
flagOnSpawn.cpp:(.text._ZN15bz_EventHandlerD1Ev[bz_EventHandler::~bz_EventHandler()]+0x26): undefined reference to `operator delete(void*)'
/tmp/cc3N5rVd.o: In function `FlagOnSpawnHandler::~FlagOnSpawnHandler()':
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD1Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0x4e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD1Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0xc3): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD1Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0x10b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
flagOnSpawn.cpp:(.text._ZN18FlagOnSpawnHandlerD1Ev[FlagOnSpawnHandler::~FlagOnSpawnHandler()]+0x158): undefined reference to `operator delete(void*)'
/tmp/cc3N5rVd.o: In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x27): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x30): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x40): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x51): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned long)'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x5e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x71): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/cc3N5rVd.o: In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)':
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_PKS3_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)]+0x1e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_PKS3_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)]+0x2b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)'
flagOnSpawn.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_PKS3_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)]+0x3e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/cc3N5rVd.o: In function `bool std::operator!=<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)':
flagOnSpawn.cpp:(.text._ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_EPKS3_[bool std::operator!=<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)]+0x19): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
/tmp/cc3N5rVd.o: In function `bool std::operator==<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)':
flagOnSpawn.cpp:(.text._ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_EPKS3_[bool std::operator==<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)]+0x19): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
/tmp/cc3N5rVd.o:(.rodata._ZTI18FlagOnSpawnHandler[typeinfo for FlagOnSpawnHandler]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/cc3N5rVd.o:(.rodata._ZTI15bz_EventHandler[typeinfo for bz_EventHandler]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/tmp/cc3N5rVd.o:(.rodata._ZTV15bz_EventHandler[vtable for bz_EventHandler]+0x20): undefined reference to `__cxa_pure_virtual'
/tmp/cc3N5rVd.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

if that is the wrong way to compile it plz let me know how --MDKSPR
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5195
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Post by JeffM »

yes that is the wrong way to do it. It needs to link with stuff in bzflag. Most plugins are built as part of the bzflag build system. if it is a third party plugin you should ask the author what the suggested build procedure is for your OSS.
ImageJeffM
Post Reply