Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/119.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将GCC makefile脚本转换为LLVM 3.0编译器_Ios_Makefile_Llvm_Clang - Fatal编程技术网

Ios 将GCC makefile脚本转换为LLVM 3.0编译器

Ios 将GCC makefile脚本转换为LLVM 3.0编译器,ios,makefile,llvm,clang,Ios,Makefile,Llvm,Clang,我正在为iPhone开发一个开源项目,并已将该项目转换为使用ARC和Apple LLVM 3.0编译器。但是,该项目依赖于使用C编写的makefile构建的外部库。目前,它使用GCC进行编译,在编译过程中,它引用了ARC-C代码,这会导致错误,因为某些符号(如@autorelease)在预LLVM编译器上不存在 但这已经够了。我的问题是如何转换这段代码: VERSION=4.3 COPT = -F/Developer/Platforms/iPhoneOS.platform/Developer/S

我正在为iPhone开发一个开源项目,并已将该项目转换为使用ARC和Apple LLVM 3.0编译器。但是,该项目依赖于使用C编写的makefile构建的外部库。目前,它使用GCC进行编译,在编译过程中,它引用了ARC-C代码,这会导致错误,因为某些符号(如@autorelease)在预LLVM编译器上不存在

但这已经够了。我的问题是如何转换这段代码:

VERSION=4.3
COPT = -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/Frameworks -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/PrivateFrameworks -I../../ -I../../Classes/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/gcc/arm-apple-darwin9/4.2.1/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk  -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/lib -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/include/
COPT += -march=armv7-a -miphoneos-version-min=${VERSION} -I. -O3 -D__IPHONE__ -D_SNESPPC -DASM_SPC700 -DZLIB -DUNZIP_SUPPORT -DOLD_COLOUR_BLENDING -DUSE_SA1 -DSUPER_FX -DLSB_FIRST -DCPU_SHUTDOWN -DVAR_CYCLES
COPT += -fnested-functions -funsigned-char -ffast-math -fexpensive-optimizations -ftemplate-depth-36 -mstructure-size-boundary=32 -falign-functions=32 -falign-loops -falign-labels -falign-jumps -finline -finline-functions -fno-builtin -fno-common -fomit-frame-pointer -fpeel-loops -fstrength-reduce -funroll-loops -fstrict-aliasing 
GCC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1
GXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-g++-4.2.1
STRIP = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip
要使用LLVM编译器?我已尝试将其修改为:

VERSION=5.0
COPT = -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/Frameworks -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/System/Library/PrivateFrameworks -I../../ -I../../Classes/ -I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/clang/3.0/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk  -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/lib -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${VERSION}.sdk/usr/include/
COPT += -march=armv7-a -miphoneos-version-min=${VERSION} -I. -O3 -D__IPHONE__ -D_SNESPPC -DASM_SPC700 -DZLIB -DUNZIP_SUPPORT -DOLD_COLOUR_BLENDING -DUSE_SA1 -DSUPER_FX -DLSB_FIRST -DCPU_SHUTDOWN -DVAR_CYCLES
COPT += -fnested-functions -funsigned-char -ffast-math -fexpensive-optimizations -ftemplate-depth-36 -mstructure-size-boundary=32 -falign-functions=32 -falign-loops -falign-labels -falign-jumps -finline -finline-functions -fno-builtin -fno-common -fomit-frame-pointer -fpeel-loops -fstrength-reduce -funroll-loops -fstrict-aliasing 
GCC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang
GXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++
STRIP = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/strip
但这是针对i386体系结构,而不是针对iOS的ARM体系结构,因此我会遇到以下错误:

"i386/types.h" not found

有专门为手臂设计的叮当吗?还是我完全错过了什么?

试试
-arch-armv7
;您需要明确指定要使用clang为ARM构建的目标。

您的包含路径中有一个iPhoneOS3.0.sdk和gcc,这不是仅适用于更高版本的OSs吗?是的,这不会影响代码,但我还是更新了问题。是的,这就是问题所在。现在编译时出现了一个新错误,但我需要进一步研究错误的确切含义。