Click here to Skip to main content
15,888,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello all,
I want to read and write xls file using c++, and I found a library named "xlslib".
I compiled it successfully in centos 7 , but Now I want to compile it in ubuntu. the gcc version is 4.8 in ubuntu and I don't know how to solve this question. can you help me ? the compile error output is the following:

VB
../../src/.libs/libxls.a(extformat.o): In function `xlslib_core::xf_init_t::operator=(xlslib_core::xf_init_t const&)':
/home/szapp/songluping/workspace/xlslib/xlslib/src/xlslib/extformat.cpp:272: undefined reference to `__cxa_allocate_exception'
/home/szapp/songluping/workspace/xlslib/xlslib/src/xlslib/extformat.cpp:272: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/home/szapp/songluping/workspace/xlslib/xlslib/src/xlslib/extformat.cpp:272: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/home/szapp/songluping/workspace/xlslib/xlslib/src/xlslib/extformat.cpp:272: undefined reference to `__cxa_throw'
/home/szapp/songluping/workspace/xlslib/xlslib/src/xlslib/extformat.cpp:272: undefined reference to `__cxa_free_exception'
../../src/.libs/libxls.a(extformat.o): In function `basic_ios':
/usr/include/c++/4.8/bits/basic_ios.h:456: undefined reference to `std::ios_base::ios_base()'
../../src/.libs/libxls.a(extformat.o): In function `basic_ostream':
/usr/include/c++/4.8/ostream:385: undefined reference to `VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/include/c++/4.8/ostream:385: undefined reference to `VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
../../src/.libs/libxls.a(extformat.o): In function `basic_ios':
/usr/include/c++/4.8/bits/basic_ios.h:456: undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >'
../../src/.libs/libxls.a(extformat.o): In function `basic_ostream':
/usr/include/c++/4.8/ostream:385: undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
../../src/.libs/libxls.a(extformat.o): In function `basic_ostringstream':
Posted
Comments
CPallini 12-Feb-15 4:22am    
Are you using the g++ (not gcc) command to compile, right?
solook1n 12-Feb-15 21:25pm    
yes

1 solution

All those messages that say undefined reference are telling you that some library is missing when the linker tries to link the object modules. The order of the libraries in your linker options is significant, as described in https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html[^].
 
Share this answer
 
Comments
solook1n 12-Feb-15 4:19am    
but I have installed the gcc and g++ library
Richard MacCutchan 12-Feb-15 4:30am    
You have also ignored everything I said in my answer above. Go to the link I posted and study the details of the link process.
solook1n 9-Mar-15 2:47am    
是官方发布的代码里面targets目录的makefile写错了。
Richard MacCutchan 9-Mar-15 4:30am    
No, or maybe yes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900