简体   繁体   中英

New C++ Project in Xcode 10.2 is not building

Have a macOS Mojave 10.14.6 with Xcode 10.2 (10E125)

I simply created new c++ project in this way:

Xcode -> New Project -> Command Line Tool -> [C++ Language] -> Next/Done

And it's not building at all. I even not touched code.

Here is errors

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:74:64: Use of undeclared identifier 'strchr'

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:81:75: Use of undeclared identifier 'strpbrk'

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:88:65: Use of undeclared identifier 'strrchr'; did you mean 'strchr'?

etc...

在此处输入图片说明

NOTE 1: I tried to create same project but with C Language. And C Project working well until I'm adding #include <vector> . With vector I have same errors as in case with new C++ project.

NOTE 2: I don't think, that something is not been installed on my system. Since the same code works well with Objective-C project. (and I do not want to use h+mm I want to use hpp+cpp, if that is the problem)

I have your same setup, and it doesn't occur to me. Was you XCode installation like this from the start, or did it happen after you've done a couple of projects?

If it happened later on, my reasoning is this; once I used the fix button inside of XCode, but, instead of fixing my own code, it went and modified a system header. Perhaps this is what happened to you as well?

If that's the case, you need to reinstall the whole party.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM