Theos make 出错 (#error Unsupported architecture)

makefile中配置:
ARCHS = armv7 arm64
#VALID_ARCHS = armv7 armvs7 arm64
TARGET = iphone:latest:8.0
Tweak_FILES = Tweak.xm HttpUtility.m

make 出错:
In file included from HttpUtility.m:9:
In file included from ./HttpUtility.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/sys/types.h:75:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/include/sys/cdefs.h:680:2: error: Unsupported
architecture
#error Unsupported architecture

如果我把文件 HttpUtility.m 中内容复制到tweak.xm中,去掉HttpUtility.m,make就成功了。
有遇到的吗?为什么不能简单拆分代码到单独的文件中。

运行一下make messages=yes试试

生成了 dylib 的。。帮看看

/Users/xxx/Code/iostweak/theos/bin/logos.pl -c warnings=error Tweak.xm > ./obj/Tweak.xm.mm
xcrun -sdk iphoneos g++ -x objective-c++ -c -I"/Users/xxx/Code/iostweak" -DTARGET_IPHONE=1 -O2 -I/Users/xxx/Code/iostweak/theos/include -include /Users/xxx/Code/iostweak/theos/Prefix.pch -Wall -Werror -isysroot “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk” -arch armv7 -arch arm64 -D__IPHONE_OS_VERSION_MIN_REQUIRED=__IPHONE_8_1 -miphoneos-version-min=8.1 -include “logos/logos.h” ./obj/Tweak.xm.mm -o obj/Tweak.xm.2b9f708c.o
rm ./obj/Tweak.xm.mm
xcrun -sdk iphoneos g++ -x objective-c -c -DTARGET_IPHONE=1 -O2 -I/Users/xxx/Code/iostweak/theos/include -include /Users/xxx/Code/iostweak/theos/Prefix.pch -Wall -Werror -isysroot “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk” -arch armv7 -arch arm64 -D__IPHONE_OS_VERSION_MIN_REQUIRED=__IPHONE_8_1 -miphoneos-version-min=8.1 -std=c99 HttpUtility.m -o obj/HttpUtility.m.2b9f708c.o
xcrun -sdk iphoneos g++ -L/Users/xxx/Code/iostweak/theos/lib -lobjc -framework Foundation -framework CoreFoundation -ObjC++ -fobjc-exceptions -fobjc-call-cxx-cdtors -framework UIKit -framework Foundation -lsubstrate -dynamiclib -install_name “/Library/MobileSubstrate/DynamicLibraries/iostweak.dylib” -isysroot “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk” -arch armv7 -arch arm64 -D__IPHONE_OS_VERSION_MIN_REQUIRED=__IPHONE_8_1 -miphoneos-version-min=8.1 -multiply_defined suppress -o “obj/iostweak.dylib.ba964c90.unsigned” obj/Tweak.xm.2b9f708c.o obj/HttpUtility.m.2b9f708c.o
xcrun -sdk iphoneos strip -x “obj/iostweak.dylib.ba964c90.unsigned”
CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate" ldid -S “obj/iostweak.dylib.ba964c90.unsigned”; mv “obj/iostweak.dylib.ba964c90.unsigned” “obj/iostweak.dylib”

make messages=yes貌似没有报错啊?

前面也报错了 和第一楼的错误一样的 这段最后的输出

deb 和dylib 都打出来了 似乎也能运行 晕了

是不是要将.m文件改成.mm文件.
纯属猜想.毕竟里面的区别还是存在的 :smile: