“start”引用自:-u命令行选项ld:找不到符号。

3

我尝试根据Jonathan Zdziarski的书《Hacking and Securing iOS Applications》中的示例构建一个包含许多对象文件的示例。但是,在使用以下命令编译二进制文件时:

export PLATFORM=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
$PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -o launchd launchd.o syscalls.o -static -nostartfiles -nodefaultlibs -nostdlib -W1,-e,_main

终端显示如下: Undefined symbols for architecture armv7: "start", referenced from: -u command line option ld: symbol(s) not found for architecture armv7 collect2: ld returned 1 exit status 通常来说,当缺少库文件时就会出现这个消息,但是我该怎么找出哪一个库文件呢?我非常确定源代码没有问题。
1个回答

1

-arch armv7 -isysroot -L$(SDK) -L$(SDK)/usr/lib/system

指定编译架构为armv7,系统根目录路径为$(SDK),并在$(SDK)/usr/lib/system下寻找库文件。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接