iOS: Photon Realtime 4.1.4 link error using Xcode 8.1 and libstdc++

Options
Hi!

I'm trying to link my proprietary game engine with Photon Realtime SDK v 4.1.4.0.
I'm using Xcode 8.1, target platform iOS, planning to upgrade to Xcode 8.2 soon. Added some test source and Photon libraries but got link errors:
"std::__1::mutex::~mutex()", referenced from:
__GLOBAL__sub_I_PeerBase.cpp in libPhoton-cpp_release_iphoneos.a(PeerBase.o)
"std::__1::mutex::lock()", referenced from:
ExitGames::Photon::Internal::PeerBase::serviceBasic() in libPhoton-cpp_release_iphoneos.a(PeerBase.o)
ExitGames::Photon::Internal::PeerBase::onPingResponse(ExitGames::Common::JString const&, unsigned int) in libPhoton-cpp_release_iphoneos.a(PeerBase.o)
"std::__1::mutex::unlock()", referenced from:
ExitGames::Photon::Internal::PeerBase::serviceBasic() in libPhoton-cpp_release_iphoneos.a(PeerBase.o)
ExitGames::Photon::Internal::PeerBase::onPingResponse(ExitGames::Common::JString const&, unsigned int) in libPhoton-cpp_release_iphoneos.a(PeerBase.o)
ld: symbol(s) not found for architecture arm64

I see it can't find std::mutex, I using libstdc++ (=NO C++11 allowed) that's why. But I need to use libstdc++, all my third-party libraries are linked to it. Also game engine will likely break if I somehow change C++ standard library to libc++.
So, please could You support libstdc++, better to have some hot fix for 4.1.4.0 or if it's difficult, I may switch to newer Photon SDK.

I hope to see Your solution for such easy problem soon, and then I can use Your SDK, thanks!

Comments

  • Kaiserludi
    Options
    Hi @Dmitry_Stepanushkin.

    We switched from libstdc++ to libc++ on Apple platforms a while ago, because that is the new standard in Xcode for quite some time now. As literally everyone on Apple platforms required libc++ builds instead of libstdc++ ones, we never needed to offer builds against both. You are literally the first one ever asking for libstdc++ support on iOS since we switched. We likely could provide up to date builds against libstdc++, but I would have to have a look to be sure.

    However I am afraid that even if we would compile against libstdc++ on iOS, we would still need to keep C++11 enabled to be able to compile all the source.
    Due to limitations of the platform or specific requirements by customers who were willing to pay for custom features the codebase actually is mostly C++03 compatible and makes very limited use of C++11 and up features, so that we can produce entirely C++03 compatible builds for certain platforms.
    These special builds don't support the full feature-set (the feature to ping all Photon Cloud regions and connect to the one with the lowest ping can't be used without C++ 11 and more features are likely to follow at some point in the future) and we have never done a No-C++11 Build for iOS.

    I will have a look and see if we can support this, but as it is nearly Christmas time, when most of our team is on vacation, I doubt that we can add support for this before next year.
    You would definitely need to update to latest (as 4.1.4.0 is the latest currently available version that won't be too much of an update for you).
  • Hi @Kaiserludi
    Thanks for reply! I understand that libstdc++ is obsolete, but unfortunately I still need to release a couple of games on that old engine. I think I can wait for compatible SDK like until February 2017. Then I need something working or drop Photon and search for other solutions.
    I don't need all features, just basic API to be able to implement online game with up to 2 players, and it's like turn based. I don't know if it's only an error but what I saw from log is usage of std::mutex in some of Photon SDK modules. If it's only the thing I thought it may be fixed pretty easily, like u did with JString, JVector. Probably add JMutex and use pthreads mutex there.
    Anyway I hope it's not that difficult and hope for support in future. Definitely will happen much faster than porting of C++ parts of our engine to make it not crash using libc++.

    Sorry but the reason is we didn't migrate to C++11 is our engine still supports some platforms that have no and will never have C++11 support. These will be dropped in maybe next year, I hope.
  • Kaiserludi
    Options
    Hi @Dmitry_Stepanushkin.

    We have added GCC C++ 98 builds in 4.1.5.0, which got just released today.
  • @Kaiserludi Thank You! I'll try it.
  • @Kaiserludi Updated to 4.1.5.0. It worked, iOS build errors are resolved. Thanks!