我有一个 C 程序,它使用 ASL 库来获取 iPhone 上的应用程序日志。现在,我已经在 Mac 上编译了它,它运行良好,在 mac 上获取应用程序的日志。当我将编译后的文件 scp 到 iPhone 并尝试执行它时,它说'可执行文件中的错误 cpu 类型'。所以,我在 iPhone 上安装了 GNU C 编译器并编译了它。现在,当我编译它时,它显示如下错误:
cP-iphone:~ root# gcc test.c
test.c:1:19: error: stdio.h: No such file or directory
test.c:2:17: error: asl.h: No such file or directory
test.c: In function 'main':
test.c:5: warning: incompatible implicit declaration of built-in function 'printf'
test.c:16: error: 'aslmsg' undeclared (first use in this function)
test.c:16: error: (Each undeclared identifier is reported only once
test.c:16: error: for each function it appears in.)
test.c:16: error: expected ';' before 'q'
test.c:21: error: 'q' undeclared (first use in this function)
test.c:21: error: 'ASL_TYPE_QUERY' undeclared (first use in this function)
test.c:22: error: 'ASL_KEY_SENDER' undeclared (first use in this function)
test.c:22: error: 'ASL_QUERY_OP_EQUAL' undeclared (first use in this function)
test.c:23: error: 'aslresponse' undeclared (first use in this function)
test.c:23: error: expected ';' before 'r'
test.c:24: error: 'NULL' undeclared (first use in this function)
test.c:24: error: 'm' undeclared (first use in this function)
test.c:24: error: 'r' undeclared (first use in this function)
test.c:27: warning: assignment makes pointer from integer without a cast
test.c:30: warning: assignment makes pointer from integer without a cast
请建议我需要做什么才能在 iPhone 上编译和运行 ac 文件。