xcode - Mixing stdc++ and libc++ in an iOS project -


i having difficult time configuring ios project uses static library linked against old libstdc++ gcc used. library 32 , 64-bit.

there 6 libraries (libssl.a example) 32-bit , must updated. if compile libraries source, automatically linked libc++, result in linker complaining.

therefore, here questions:

1) there way have single static library inside project use libstdc++, , have others use libc++?

2) how can compile libraries source (like libcrypto , libssh) , force them use old libstdc++ standard library?

3) there other way out of mess?

1) yes, can mix , match c++ runtimes c++ code uses long separate modules don't pass objects between each-other. example, if have 2 modules in app expose c apis internally use c++, each can use whichever c++ runtime want. problems occur when trying share objects between runtimes.

2) can use '--stdlib=libstdc++' or '--stdlib=libc++' command line argument when compiling , linking specify c++ library use. if final executable needs link against both, you'll need manually specify other 1 (eg: --stdlib=libc++ -lstdc++).

3) yep, note libstdc++ deprecated years ago , isn't available on watchos nor tvos, best bet on libc++.


Comments