iPhone - Why can the compiler not find some includes when building for ARM architecture?

前端 未结 4 1596
故里飘歌
故里飘歌 2021-01-05 18:58

I am trying to make use of a C library in an iPhone project. I am very green with iPhone development. My Library

I have been battling for days now to try and get th

4条回答
  •  温柔的废话
    2021-01-05 19:29

    I've had some success adding the following to my .bash_profile:

    # OS SDK PATHS
    IPHONE_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
    IPHONESIM_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
    MACOSX_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
    
    export IPHONE_SDK
    export IPHONESIM_SDK
    export MACOS_SDK
    
    C_INCLUDE_PATH=$HOME/local/include:$IPHONE_SDK/usr/include:$IPHONESIM_SDK/usr/include
    CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH
    
    export C_INCLUDE_PATH
    export CPLUS_INCLUDE_PATH
    

    This gives adds all of the architecture-dependent header files to your include folder. After that, I was able to compile C++ libraries without any other modifications.

提交回复
热议问题