JString compile error when i use XCode6.3 to build.

Options
iwahara
iwahara
edited April 2015 in Native
Hi.

I updated xcode from 6.2 to 6.3.
I'm trying to build sources, but always getting the compilation error.


Error message is shown below:
Application/libs/iOS/photon/Common-cpp/inc/JString.h:123:53: No type named 'basic_ostream' in namespace 'std'

Although I have done a post such as the following in the past,
I wonder of events, such as similar as well this time.

viewtopic.php?f=8&t=5458

Thanks.

Comments

  • Kaiserludi
    Options
    Hi iwahara.

    Can you reproduce this with our demos?
    Xcode 6.3 works just fine for me and I can't reproduce that issue.
  • iwahara
    Options
    Hi Kaiserludi.

    I tried it. it works all right.
    But, this problem reproduce, when "Build Settings -> C++ Language Dialect" changes to "C++11[-std=c++11]" and "Build Settings -> C++ Standard Library" changes to "libc++(LLVM C++ statndard library with C++ 11 support)" and "Build Settings -> deployment target" changes "5.0".
    Demo is latest version(4.0.1.1).

    These settings is cocos2d-x 3.x default value.
    So, I can't change value.

    Thanks.
  • Kaiserludi
    Options
    Hi iwahara.

    I could reproduce this. This is caused by an ABI incompatibility between libstdc++ (gcc stdlib) and libc++ (clang stdlib).

    From version 4.0.2.0 on you can deactivate the affected code lines to be able to successfully build against libc++.
    To achieve that, simply add the line
    [code2=cpp]#define EG_NOSTDLIB[/code2]
    before you include any Photon-header
    or alternatively add that preprocessor define to the project or target settings of your app.

    Please note that when this define is in place code like
    [code2=cpp]std::wcout << myJString;[/code2]
    won't correctly output the contents of a JString instance anymore.

    Instead you will have to replace such code by
    [code2=cpp]std::wcout << myJString.cstr();[/code2]

    4.0.2.0 should get released in our download section tomorrow.
    Until then please simply replace the JString.h file in your 4.0.1.1 SDK download with the attached file.
  • iwahara
    Options
    Hi Kaiserludi.

    Thanks for your source and advice!
    I replaced the header file. The problem was solved.

    Thanks always!