Xcode 4.2 + c++0x/libc++ cannot find iostream

后端 未结 2 1545
猫巷女王i
猫巷女王i 2021-01-03 07:36

I\'m using Macbook 1g, Snow Leopard.

Few days ago i installed xcode 4.2 and made a test project for c++0x.

I set LLVM 3.0 as c++ compiler, C++ Language Diale

相关标签:
2条回答
  • 2021-01-03 08:13

    From the comments:

    Oh, i found it. libc++ as standard library requires OS X Lion! (...) I changed libc++ to libstdc++ and it compiled successfully.

    0 讨论(0)
  • 2021-01-03 08:29

    "I changed libc++ to libstdc++". How? Where is this setting? Apple documentation says "simply set "C++ Standard Library Type" in the build settings to ... " Build settings is long and I don't see the place to set. Thanks.

    Edit - Nothing like a nap to clear the head.

    Be sure to make the file name suffix of the implementation file to be ".mm".

    Project->Build Settings->Apple LLVM compiler 3.1-Language-> Then: C++ Language Dialect->C++11 (or whatever option) C++ Standard Library->libstdc++

    And don't forget this last one! Compile Sources as->Objective-C++

    0 讨论(0)
提交回复
热议问题