Question:
I get the following errors when trying to compile my "C" program with the Chilkat library:
/usr/lib/chilkat-9.5.0-x86_64-linux-gcc/lib/libchilkat-9.5.0.a(C_CkCrypt2.o):(.data.DW.ref.gxx_personality_v0[DW.ref.gxx_personality_v0]+0x0): undefined reference to__gxx_personality_v0' /usr/lib/chilkat-9.5.0-x86_64-linux-gcc/lib/libchilkat-9.5.0.a(CkCrypt2.o): In function
CkCrypt2::createNew()': CkCrypt2.cpp:(.text+0x710e): undefined reference tooperator new(unsigned long)' CkCrypt2.cpp:(.text+0x712b): undefined reference to
operator delete(void)' CkCrypt2.cpp:(.text+0x713c): undefined reference to__cxa_begin_catch' CkCrypt2.cpp:(.text+0x7141): undefined reference to
__cxa_end_catch' /usr/lib/chilkat-9.5.0-x86_64-linux-gcc/lib/libchilkat-9.5.0.a(CkCrypt2.o): In functionCkCrypt2::~CkCrypt2()': CkCrypt2.cpp:(.text+0x70fd): undefined reference to
operator delete(void)'
Anytime you see link errors such as this:
/usr/lib/chilkat-9.5.0-x86_64-linux-gcc/lib/libchilkat-9.5.0.a(C_CkCrypt2.o):(.data.DW.ref.gxx_personality_v0[DW.ref.gxx_personality_v0]+0x0): undefined reference towhere you see strings such as:__gxx_personality_v0' /usr/lib/chilkat-9.5.0-x86_64-linux-gcc/lib/libchilkat-9.5.0.a(CkCrypt2.o): In function
CkCrypt2::createNew()': CkCrypt2.cpp:(.text+0x710e): undefined reference tooperator new(unsigned long)' CkCrypt2.cpp:(.text+0x712b): undefined reference to
operator delete(void*)' CkCrypt2.cpp:(.text+0x713c): undefined reference to__cxa_begin_catch' CkCrypt2.cpp:(.text+0x7141): undefined reference to
cxa_end_catch'
gxx_personality operator new operator delete cxa_begin_catch cxa_end_catchThese are all indicators that you need to link the C++ runtime libs. To do that, use the g++ command instead of gcc.
Also.. compile and link your program in 2 steps. First compile using gcc w/ the "-c" option to produce a .o. The link with g++ so that the C++ runtime libs get linked in.