简体   繁体   中英

g++ link error for xerces-c library

g++ -std=c++14 -m32 -I/export/home/ab0599/local/include -L/export/home/ab0599/local/lib xerces_tst1.cpp -o xerces_tst1 -lxerces-c-3.2

Undefined                       first referenced
 symbol                             in file
__1cG__CrunKpure_error6F_v_         /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1cG__CrunIex_alloc6FI_pv_         /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1_v_v_ /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1cG__CrunKcross_cast6Fpvpkn0AQstatic_type_info_4_1_ /export/home/ab0599/local/lib/libxerces-c-3.2.so
typeinfo for xercesc_3_2::XMLException /var/tmp//ccjKE5ec.o
xercesc_3_2::XMLPlatformUtils::Initialize(char const*, char const*, xercesc_3_2::PanicHandler*, xercesc_3_2::MemoryManager*) /var/tmp//ccjKE5ec.o
__1cG__CrunGex_get6F_pv_            /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1cG__CrunMex_rethrow_q6F_v_       /export/home/ab0599/local/lib/libxerces-c-3.2.so
xercesc_3_2::XMLUni::fgXercescDefaultLocale      /var/tmp//ccjKE5ec.o
__1cG__CrunSregister_exit_code6FpG_v_v_ /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1cG__CrunHex_skip6F_b_            /export/home/ab0599/local/lib/libxerces-c-3.2.so
xercesc_3_2::XMLPlatformUtils::Terminate()     /var/tmp//ccjKE5ec.o
__1cG__CrunIex_clean6F_v_           /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1cG__CrunKex_rethrow6F_v_         /export/home/ab0599/local/lib/libxerces-c-3.2.so
c::c(N6,  (int0_t))                 /export/home/ab0599/local/lib/libxerces-c-3.2.so
c::c(n6,  (int0_t))                 /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1c2K6Fpv_v_                       /export/home/ab0599/local/lib/libxerces-c-3.2.so
__1c2k6Fpv_v_                       /export/home/ab0599/local/lib/libxerces-c-3.2.so
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status

Please, help to solve the problem. I tried diffferent combination of parameters but nothing help.

I have solved the problem. The problem was, that I did configuration with CC compiler:

./configure --prefix=/export/home/ab0599/local --disable-network CC=cc CXX=CC CFLAGS=-m64 CXXFLAGS=-m64

but tried to compile example with gcc. Now, I have compiled library by gcc compiler and the problem was solved.

Please check the (in my opinion) mismatching paths given in "-L/export/home/sian/local/lib" and shown in "/export/home/ab0599/local/lib". If you have a link to that path, thats ok.

make an ldd /export/home/ab0599/local/lib/libxerces-c-3.2.so and try to solve the (probably missing) dependencies.

If the dependencies are satisfied, you probably have a version mismatch (most likely your libxerces was built with another version of a common dependency than your xerces_tst1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM