Search code examples
xcodeunity-game-enginevuforia

how to use libc++ and libstdc++ for different libraries in one project


enter link description herecurrently I am working on embedding unity in iOS project and I am almost completing it. However, I am having issues with my libraries.

I am embedding unity+Vuforia in my iOS project, which means in build setting c++ standard library, I have to use libc++ to get Vuforia and unity working.

On the other hand, I have some old libraries(libFMDB.a; lingos.a; libproj4.a; libShapekit.a; libSpatialDBKit.a; libspatialite.a; libsqlite3.a) that should use libstdc++ in setting. If I simply set libc++ for my build setting, I will get errors. ErrorScreenShotImage

What should I do at this point to get everything complied?

Thank you!!!!


Solution

  • Do not do this!

    Why?

    1. depending on the name mangling scheme used it might not even be possible because libc++ is going to have the same symbols as libstdc++
    2. if there are no symbol collisions you are probably going to run into undefined behavior when you take objects from one library and mix them with objects/functions from the other.
    3. class structures will not be compatible. Internal class structures will be implemented or laid out differently.
    4. libstdc++ is no longer available on iOS 12. Your program will not run on it.
    5. The correct way to fix your problem is to download/compile updated versions of your libraries. Period.