1

I'm trying to compile a static library for the opencore-amr project to use in ios. My setup is Xcode4.2 / iOS5 sdk (since I'm still running Snow Leopard). I've tweaked the build script attached here to use -isysroot instead of --sysroot, and updated the SDK var to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk

This fails in the config checks at this point:

checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/ldwong/Documents/xcode/opencore-amr-0.1.3':
configure: error: C preprocessor "/lib/cpp" fails sanity check

according to my config.log, the first failure during this check is in finding limits.h:

configure:7965: checking how to run the C preprocessor
configure:7996: gcc -arch armv6 -isysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -E  conftest.c
In file included from conftest.c:12:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/../lib/gcc/arm-apple-darwin10/4.2.1/include/limits.h:15:25: error: no include path in which to search for limits.h
configure:7996: $? = 1
configure: failed program was:
...

and farther down it also fails to find assert.h with this command:

configure:7996: gcc -arch armv6 -isysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -E -traditional-cpp  conftest.c
conftest.c:14: error: assert.h: No such file or directory

Can anyone point out what I'm missing or doing wrong? Thanks!

qix
  • 6,008
  • 1
  • 44
  • 58
  • `gcc -arch armv6 -i` etc. is wrong; you most likely want to do so using `./configure CC=arm-apple-darwin9-gcc` etc. But I can build you a library if you can wait a minute. –  May 11 '12 at 19:35
  • Thanks for the offer; I've not had to build a static library for ios before. That said, I was more interested in knowing how to do it myself. :) So in my /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/, I have no reference to a `arm-apple-darwin9-gcc*` compiler... That said, after adding `-I$SDK/usr/include/` to my CC and CXX values, it compiled successfully. Now it's another matter as to whether or not I will be able to successfully link to an ios app and call its functions properly. ;) – qix May 11 '12 at 21:00
  • Sorry, it wasn't darwin9-gcc, it's just my old build :D Anyway I'm glad you've got it working. –  May 11 '12 at 21:04

0 Answers0