Can't choose libc++ or libstdc++ in XCode

3.5k Views Asked by At

I am trying to build a project in XCode which uses both Cinder and OpenSubdiv.

They conflict in many ways and I have solved most problems but the last one is giving me a headache.

I have a linker error:

"Undefined symbols for architecture x86_64: "std::__throw_length_error(char const*)", referenced from: blah blah

After a bit of research I found that I should change "C++ Standard Library" from libc++ to libstdc++.

However, Cinder complains and tells me that it requires libc++. So I am stuck.

I managed to get Cinder and OpenSubdiv working together on windows, but on mac it is really difficult. Is there any possible way of solving this?

1

There are 1 best solutions below

0
On

The first choice would be to find out who is requesting std::__throw_length_error(char const*), and then change that code to use libc++ instead of libstdc++.

If for some reason that can not be done, you could try to link to both libc++ and libstd++ by adding /usr/lib/libstdc++.dylib to the Other Linker Flags setting (keeping libc++ your choice in "C++ Standard Library").