S
Scott Brady Drummonds
Hi, everyone,
I'm writing a bunch of C++ code that is going to be linked into a program
compiled with gcc (version 2.96; I have no option of changing this version).
My C++ code compiles and executes without error in my C++ test harness.
However, things fail once I move to gcc.
Specifically, I'm getting errors like the following:
vcs.o(.text+0xf): undefined reference to `operator new(unsigned)'
vcs.o(.text+0x49): undefined reference to `operator delete(void*)'
vcs.o(.text+0x5a): undefined reference to `_Unwind_Resume'
vcs.o(.text+0x6b): undefined reference to `operator delete(void*)'
vcs.o(.text+0xa9): undefined reference to `_Unwind_Resume'
vcs.o(.text+0x149): undefined reference to
`std::allocator<char>::allocator()'
vcs.o(.text+0x15f): undefined reference to `std::string::string(char const*,
std::allocator<char> const&)'
vcs.o(.text+0x189): undefined reference to `std::string::~string()'
vcs.o(.text+0x199): undefined reference to `std::string::~string()'
vcs.o(.text+0x1ac): undefined reference to
`std::allocator<char>::~allocator()'
vcs.o(.text+0x1bc): undefined reference to
`std::allocator<char>::~allocator()'
....
/usr/users/home4/sdrummon/src/marple/src/vcs/libVCSMarple.a(vcs.o): In
function `std::map<char const*, int, std::less<char const*>,
std::allocator<std:air<char const* const, int> > >::map()':
vcs.o(.gnu.linkonce.t._ZNSt3mapIPKciSt4lessIS1_ESaISt4pairIKS1_iEEEC1Ev+0x4c
): undefined reference to `_Unwind_Resume'
....
I have tried compiling the final binary (which uses both C and C++ compiled
objects) with "-lstdc++". That fixes these issues on gcc 3.1, but causes
the above problems with the 2.96. Perhaps another library needs to be added
to the link line?
Thanks!
Scott
I'm writing a bunch of C++ code that is going to be linked into a program
compiled with gcc (version 2.96; I have no option of changing this version).
My C++ code compiles and executes without error in my C++ test harness.
However, things fail once I move to gcc.
Specifically, I'm getting errors like the following:
vcs.o(.text+0xf): undefined reference to `operator new(unsigned)'
vcs.o(.text+0x49): undefined reference to `operator delete(void*)'
vcs.o(.text+0x5a): undefined reference to `_Unwind_Resume'
vcs.o(.text+0x6b): undefined reference to `operator delete(void*)'
vcs.o(.text+0xa9): undefined reference to `_Unwind_Resume'
vcs.o(.text+0x149): undefined reference to
`std::allocator<char>::allocator()'
vcs.o(.text+0x15f): undefined reference to `std::string::string(char const*,
std::allocator<char> const&)'
vcs.o(.text+0x189): undefined reference to `std::string::~string()'
vcs.o(.text+0x199): undefined reference to `std::string::~string()'
vcs.o(.text+0x1ac): undefined reference to
`std::allocator<char>::~allocator()'
vcs.o(.text+0x1bc): undefined reference to
`std::allocator<char>::~allocator()'
....
/usr/users/home4/sdrummon/src/marple/src/vcs/libVCSMarple.a(vcs.o): In
function `std::map<char const*, int, std::less<char const*>,
std::allocator<std:air<char const* const, int> > >::map()':
vcs.o(.gnu.linkonce.t._ZNSt3mapIPKciSt4lessIS1_ESaISt4pairIKS1_iEEEC1Ev+0x4c
): undefined reference to `_Unwind_Resume'
....
I have tried compiling the final binary (which uses both C and C++ compiled
objects) with "-lstdc++". That fixes these issues on gcc 3.1, but causes
the above problems with the 2.96. Perhaps another library needs to be added
to the link line?
Thanks!
Scott