1

EDIT: I'm using gcc 5.2.1 so apparently the library a new libstdc++ library ABI is now chosen by default. It might be the problem leading to this error message (related to std::__cxx11) when Im trying to compile my code:

/tmp/ccVIU5fG.o: In function `main':
2D_interpolations.cc:(.text+0x76): undefined reference to `mio::Config::Config(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
2D_interpolations.cc:(.text+0x151): undefined reference to `mio::IOUtils::convertString(mio::Date&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double const&, std::ios_base& (*)(std::ios_base&))'

I try to add the following line at the beginning of the .cc file

#define _GLIBCXX_USE_CXX11_ABI 0

And I was then able to compile. But I got an error related to an undefined symbol. By using

c++filt <the undefined symbol>

It turned out that the undefined symbol was actually undefined at the exact same place as where I got the error before adding #define _GLIBCXX_USE_CXX11_ABI 0

mio::Config::Config(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)

By checking whether other undefined symbols existed or not, I figured that one is missing there too (also in the previous error)

mio::IOUtils::convertString(mio::Date&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double const&, std::ios_base& (*)(std::ios_base&))

I know that there are some similar posts already but the answers were too 'theoretical' to me since I'm new to c++ and I dont know anything in computers... If you have any suggestion that could help, you're welcome!

Thanks!

Pauline
  • 21
  • 1
  • 7
  • As @zenith notes, this is a duplicate. When you look at the answers to the original question, pay particular attention to the one that refers to _GLIBCXX_USE_CXX11_ABI (if you're using gcc 5.1 or newer) – lobudge Mar 23 '16 at 23:17
  • Thanks @lobudge! After some research on the subject, It's seems to be relevant in my case since Im using gcc version 5.2.1. But Ive no idea how to fix it... All the related answer I read were quite theoretical and Im not really a computer engineer! I'll keep searching but let me know if you have any suggestion! – Pauline Mar 24 '16 at 16:49

1 Answers1

1

I managed to finally fix everything, so Im posting here the solution in case it interests someone

To check which libraries I'm using with my code, I used the command

ldd -r -d <name of my code file>

The 3rd party lib Im using was correctly detected through the path

/usr/local/lib/<name of the library file>

But it's apparently not a good path (don't ask me why), even if recognized. One good option is to change the library files to another location:

/usr/lib/<name of the library file>

It now works perfectly!

Pauline
  • 21
  • 1
  • 7