Theos Xcode9编译成功 Xcode10失败


#1

因为APP要适配iOS12所以把Xcode9.4.1升级到Xcode10,然后编译插件代码,提示如下错误(PS:只是部分错误提示)

==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
error: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found]
error: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found]
error: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found]
error: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found]
While building module 'Foundation' imported from /Users/XXX/theos/Prefix.pch:11:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from <module-includes>:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:10: fatal error: could not build module
      'Darwin'
#include <sys/types.h>
 ~~~~~~~~^
error: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found]

最后找到的解决办法是每次要编译插件代码时,Xcode->preperences->Locations->Command Line Tool选中Xcode9.4.1,要写App时选中Xcode10。但是这样太麻烦了,跪求比较好的解决方案。


#2

Xcode10移除了GCC的stdc++


#3

大神 看到你的帖子了 膜拜。


#4

更新到最新theos后,还是要加入下面两句,Xcode10才能编译通过。

FOOOOOO_CFLAGS = -std=c++11 -stdlib=libc++
FOOOOOO_LDFLAGS = -stdlib=libc++

#5

你好,我也遇到和你同样的.请问这这两句加在哪呢?我加到了Makefile无效


#6

Forest_FILES = AntForest.xm
Forest_FRAMEWORKS = UIKit Foundation
放这里就行
include $(THEOS_MAKE_PATH)/tweak.mk


#7

首先确认你是Xcode10吗 其次在Makefile中你要把F000000改成你工程的名字


#8

如你所说 已经解决 谢谢~


#9

如你所说 已经解决 谢谢了~