构建dylib使用makefile但它也回显“未找到头文件”

时间:2012-11-23 04:30:45

标签: iphone makefile

这是我的makefile

Compiler=/usr/bin/clang++
CC=/usr/bin/clang
Sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
DEVICE_SUPPORT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\)/Symbols
UIKIT_HEADER=$(Sysroot)/System/Library/Frameworks/UIKit.framework/Headers
FOUNDATION_HEADER=$(Sysroot)/System/Library/Frameworks/Foundation.framework/Headers
FRAMEWORKS=/opt/iOSOpenDev/frameworks
INCLUDE=/opt/iOSOpenDev/include
LIB=/opt/iOSOpenDev/lib
MAIN=./main


LDFLAGS=        -lobjc \
                -framework Foundation \
                -framework UIKit \
                -framework CoreFoundation \
                -framework CoreLocation \
                -multiply_defined suppress \
                -L$(INCLUDE) \
                -L$(LIB) \
                -L$(Sysroot)/usr/lib \
                -F$(Sysroot)/System/Library/Frameworks \
                -F$(Sysroot)/System/Library/PrivateFrameworks \
                -dynamiclib \
                -init _mainInitialize \
                -Wall \
                -Werror \
                -lsubstrate \
                -licucore \
                -llockdown \
                -fobjc-exceptions \
                -fobjc-call-cxx-cdtors


CFLAGS= -arch armv7 -miphoneos-version-min=4.0 -isysroot $(Sysroot) -I$(UIKIT_HEADER) -I$(FOUNDATION_HEADER) -I$(FRAMEWORKS) -I$(INCLUDE) -I$(LIB) -I$(MAIN)

HookObjects= $(MAIN)/main.o

如果我的main.h包含私有框架,它将给出错误,如:{。/ main / main.h:5:9:致命错误:'Preferences / Preferences.h'文件未找到}当我构建< / p>

1 个答案:

答案 0 :(得分:0)

只是检查可能是您导入.m文件而不是.h文件,还检查项目中添加的框架,以便从CoreLocation路径添加CoreFoundationBuild Phases->Link Binaries with Libraries->Add this frameworks框架。

我希望这可以帮到你..