Makefile 链接私有库 编译报错的解决办法

这是Xcode9.4.1报错日志

> Making all for tool ipainstaller…
==> Linking tool ipainstaller (armv7)…
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 [-Wdeprecated]
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/PrivateFrameworks'
ld: framework not found GraphicsServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/hacker/ipainstaller/.theos/obj/debug/armv7/ipainstaller] Error 1
make[2]: *** [/Users/hacker/ipainstaller/.theos/obj/debug/armv7/ipainstaller] Error 2
make[1]: *** [internal-tool-all_] Error 2
make: *** [ipainstaller.all.tool.variables] Error 2

怀疑高版本Xcode的问题,所以换了默认Xcode为8.3,下面是Xcode8.3版本的报错

==> Linking tool ipainstaller (armv7)…
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 [-Wdeprecated]
ld: framework not found GraphicsServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/Users/hacker_/ipainstaller/.theos/obj/debug/armv7/ipainstaller] Error 1
make[2]: *** [/Users/hacker_/ipainstaller/.theos/obj/debug/armv7/ipainstaller] Error 2
make[1]: *** [internal-tool-all_] Error 2
make: *** [ipainstaller.all.tool.variables] Error 2

报错的意思是找不到这个私有库,应该怎么解决?

电脑是 macOS 10.13.6 (17G2112)版本

下面是Makefile文件

export TARGET_CODESIGN_FLAGS="-Ssign.plist"
export ARCHS = armv7 arm64
GO_EASY_ON_ME=1
include /opt/theos/makefiles/common.mk

TOOL_NAME = ipainstaller
ipainstaller_FILES = \
					ZipArchive/minizip/ioapi.c \
					ZipArchive/minizip/mztools.c \
					ZipArchive/minizip/unzip.c \
					ZipArchive/minizip/zip.c \
					ZipArchive/ZipArchive.mm \
					UIDevice-Capabilities/UIDevice-Capabilities.m \
					main.mm
ipainstaller_FRAMEWORKS = Foundation UIKit ImageIO CoreGraphics
ipainstaller_PRIVATE_FRAMEWORKS = GraphicsServices MobileCoreServices
ipainstaller_LDFLAGS = MobileInstallation -lz
ipainstaller_INSTALL_PATH = /usr/bin

include /opt/theos/makefiles/tool.mk

VERSION.INC_BUILD_NUMBER = 1

before-package::
	ln -s ipainstaller $(THEOS_STAGING_DIR)/usr/bin/installipa
	find $(THEOS_STAGING_DIR) -exec touch -r $(THEOS_STAGING_DIR)/usr/bin/installipa {} \;
	chmod 0755 $(THEOS_STAGING_DIR)/usr/bin/ipainstaller
	chmod 0644 $(THEOS_STAGING_DIR)/DEBIAN/control

Xcode很久以前起就不包含私有sdk了。你需要找第三方做好的完整sdk

比如说https://github.com/theos/sdks

1 个赞

谢张总指导