0

I've just compiled the trunk version of gcc but when using g++ to compile a c++ project I see that standard library components that should be there, like std::conjunction, are missing. When I check the code in the my local repository (gcc_trunk/libstdc++-v3/include/std), everything seems to be there. How can I ensure I'm using the correct version of libstdc++ ?

Below are some commands I've used to check the system with their respective output

$ readelf -d /usr/lib64/libstdc++.so.6 | grep soname

0x000000000000000e (SONAME)             Library soname: [libstdc++.so.6]

$ ls -l /usr/lib/libstdc++.so.6

lrwxrwxrwx 1 root root 19 Jan 7 13:19 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.23

Any thoughts?

Lorah Attkins
  • 5,331
  • 3
  • 29
  • 63

1 Answers1

0

I assume you've installed new GCC to some non-standard location (i.e. not under /usr) so at runtime your app tries to use host /usr/lib/libstdc++.so which is incompatible. To solve this problem you can do either of

  • run your app with LD_LIBRARY_PATH set to point to new GCC library folder
  • link your app with -Wl,-rpath
  • statically link with libstdc++ via -static-libstdc++ (this is a partial solution as other compiler libs e.g. libgcc.so will still come from host GCC)
Community
  • 1
  • 1
yugr
  • 19,769
  • 3
  • 51
  • 96
  • But I have a compile time error, this can't be a runtime error (eg `conjunction` is not a member of std) – Lorah Attkins Jan 09 '17 at 20:58
  • I suggest you provide more details in your question. E.g. atm it's unclear whether it's runtime or compile-time error... – yugr Jan 09 '17 at 21:08