Xcode looking in wrong location for CFNetwork framework - ios

I wouldn't be surprised if this is something stupid that I'm doing... This is an iOS target project.
MacOS: 10.7 Lion
Xcode: 4.1
Target: iPhone 4.3
I used ASI's ASIHTTPRequest add-in framework in a different project and it worked fine.
I've added it to the current project I'm working on and now Xcode is looking for the CFNetwork framework in a project directory instead of the SDK location. I have not added any search locations and have verified that the CFNetwork framwork location is set to "Relative to SDK" and is looking at the "System/Library/Frameworks" directory.
As you can see at the bottom of the error message, it is looking in the wrong folder for the framework—it is looking inside the project folder.
Please let me know if you have any thoughts as to what I am doing wrong.
Thanks!
Error message:
CompileC /Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/Objects-normal/i386/ASIDownloadCache.o ASIDownloadCache.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Volumes/One.One/Development/Cam-MoonCo_TabBar/MoonCo_CustomTabBar
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -DDEBUG -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=attribute((iboutlet))" "-DIBOutletCollection(ClassName)=attribute((iboutletcollection(ClassName)))" "-DIBAction=void)attribute((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -iquote /Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/MoonCo_TiltFinder-generated-files.hmap -I/Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/MoonCo_TiltFinder-own-target-headers.hmap -I/Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/MoonCo_TiltFinder-all-target-headers.hmap -iquote /Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/MoonCo_TiltFinder-project-headers.hmap -I/Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Products/Debug-iphonesimulator/include -I/Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/DerivedSources/i386 -I/Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/DerivedSources -F/Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Products/Debug-iphonesimulator -F/Volumes/One.One/Development/Cam-MoonCo_TabBar/MoonCo_CustomTabBar -include /Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/PrecompiledHeaders/MoonCo_CustomTabBar-Prefix-ezvknrzjsqbjxdfzxcnzjkisdtlw/MoonCo_CustomTabBar-Prefix.pch -MMD -MT dependencies -MF /Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/Objects-normal/i386/ASIDownloadCache.d -c /Volumes/One.One/Development/Cam-MoonCo_TabBar/MoonCo_CustomTabBar/ASIDownloadCache.m -o /Users/mooner/Library/Developer/Xcode/DerivedData/MoonCo_TiltFinder-gzpflywfciaabtachdctgqaarhmu/Build/Intermediates/MoonCo_TiltFinder.build/Debug-iphonesimulator/MoonCo_TiltFinder.build/Objects-normal/i386/ASIDownloadCache.o
fatal error: cannot open file '/Volumes/One.One/Development/Cam-MoonCo_TabBar/MoonCo_CustomTabBar/CFNetwork.framework/Headers/CFHTTPMessage.h':

Had the same problem. Cleaning the project via Command Shift K solved it for me.

Related

Build openssl for arm64 iOS simulator

Description
I'm trying build iphonesimulator-only targeted library witn architecture arm64, but linking step failed with error:
${LDCMD:-/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang} -O3 -fvisibility=hidden -miphoneos-version-min=9.0 -fembed-bitcode -fPIC -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L. -Wl,-search_paths_first \
-o apps/openssl apps/asn1pars.o apps/ca.o apps/ciphers.o apps/cms.o apps/crl.o apps/crl2p7.o apps/dgst.o apps/dhparam.o apps/dsa.o apps/dsaparam.o apps/ec.o apps/ecparam.o apps/enc.o apps/errstr.o apps/gendsa.o apps/genpkey.o apps/genrsa.o apps/nseq.o apps/ocsp.o apps/openssl.o apps/passwd.o apps/pkcs12.o apps/pkcs7.o apps/pkcs8.o apps/pkey.o apps/pkeyparam.o apps/pkeyutl.o apps/prime.o apps/rand.o apps/rehash.o apps/req.o apps/rsa.o apps/rsautl.o apps/s_client.o apps/s_server.o apps/s_time.o apps/sess_id.o apps/smime.o apps/speed.o apps/spkac.o apps/srp.o apps/storeutl.o apps/ts.o apps/verify.o apps/version.o apps/x509.o \
apps/libapps.a -lssl -lcrypto
ld: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/libSystem.tbd) built for iOS Simulator, file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/libSystem.tbd' for architecture arm64
Configuraton command:
./Configure iossimulator-xcrun threads no-shared "-fvisibility=hidden -miphoneos-version-min=9.0 -fembed-bitcode -fPIC" no-asm no-hw no-async --prefix=/Users/macosuser/Build/OpenSSL/Install "-arch arm64" "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk"
Configuring OpenSSL version 1.1.1j (0x101010afL) for iossimulator-xcrun
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile
Build commands look like this:
...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -I. -Iinclude -Iapps -O3 -fvisibility=hidden -miphoneos-version-min=9.0 -fembed-bitcode -fPIC -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -D_REENTRANT -DNDEBUG -MMD -MF apps/x509.d.tmp -MT apps/x509.o -c -o apps/x509.o apps/x509.c
...
Question
I can't figure out why for other architectures (i386, x86_64) the build happens without problems.
Perhaps I am missing some nuance, but I cannot understand which one.
Why do I need this - an application using this library must run on a simulator in a macbook with an M1 processor.
Environment specifications
MacOS 11.4
XCode v12.5
OpenSSL v1.1.1j
Compiler - AppleClang 12.0.5.12050022
Because i'm not an iOS developer, i didn't immediately understand the specifics of building libraries through make for this platform.
The problem was this:
-miphoneos-version-min specifies the deployment target for iOS, but since i am building library for the iOS simulator, me need to use -mios-simulator-version-min.
As a result, the configuration command should look like this:
./Configure iossimulator-xcrun threads no-shared "-fvisibility=hidden -mios-simulator-version-min=9.0 -fembed-bitcode -fPIC" no-asm no-hw no-async --prefix=/Users/macosuser/Build/OpenSSL/Install "-arch arm64" "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk"
If anyone can explain why the -miphoneos-version-min flag works as expected for i386 and x86_64 architectures, i would be grateful.

Compiling libidin.a to iOS

I want to compile the libidin.a framework to iOS but I ran into a terminal problem during so.
This is the guide i'm using to do that:
https://github.com/robbiehanson/XMPPFramework/wiki/CompilingLibidn
The guide says I should cd to the folder where the libidin.a is at and write the following line:
./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --disable-shared CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 CFLAGS="-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
But I get the follwing answer:
-bash: ./configure: No such file or directory
Since I have no clue about what i'm doing in terminal, I really need your help.
Thanks
Ok,
I found out that I added the precompiled libidin.a file only one of my targets and this is why it failed.

Creating an iOS Simulator Build with Cordova for Facebook review

I need to hand in a new version of our app to submit my request for new Facebook permissions.
The problem is, that it is not possible to build the iOS simulator build like described here.
I attached my complete output on gist.
The most important parts are these ones:
SebastiansMBP2:ios <user>$ xcodebuild -arch i386 -sdk iphonesimulator8.0
Build settings from command line:
ARCHS = i386
SDKROOT = iphonesimulator8.0
=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
...
2014-10-21 11:44:28.029 xcodebuild[67280:364513] DeveloperPortal: Using pre-existing current store at URL (file:///Users/<user>/Library/Developer/Xcode/DeveloperPortal%206.0.db).
=== BUILD TARGET <ProjectName> OF PROJECT <ProjectName> WITH THE DEFAULT CONFIGURATION (Release) ===
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AdjustCordova.o <ProjectName>/Plugins/com.adjust.sdk/AdjustCordova.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/<user>/Development/20/<ProjectName>/platforms/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/<user>/.rvm/gems/ruby-2.0.0-p451/bin:/Users/<user>/.rvm/gems/ruby-2.0.0-p451#global/bin:/Users/<user>/.rvm/rubies/ruby-2.0.0-p451/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/<user>/.rvm/bin:/Users/<user>/.adt/tools:/Users/<user>/.adt/platform-tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=270 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=c99 -fobjc-arc -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/<ProjectName>-generated-files.hmap -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/<ProjectName>-own-target-headers.hmap -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/<ProjectName>-all-target-headers.hmap -iquote /Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/<ProjectName>-project-headers.hmap -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/Release-iphonesimulator/include -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/Release-iphonesimulator/usr/local/lib/include -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/UninstalledProducts/include -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/Release-iphonesimulator -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/DerivedSources/i386 -I/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/DerivedSources -F/Users/<user>/Development/20/<ProjectName>/platforms/ios/build/Release-iphonesimulator -F/Users/<user>/Development/20/<ProjectName>/platforms/ios/Safe -F/Users/<user>/Development/20/<ProjectName>/platforms/ios/<ProjectName>/Plugins/com.phonegap.plugins.facebookconnect -include /var/folders/pn/gg2pmp494ddc28vb35296c7r0000gn/C/com.apple.DeveloperTools/6.0-6A313/Xcode/SharedPrecompiledHeaders/<ProjectName>-Prefix-buzdrrssmquhyjccbctulbjeosdy/<ProjectName>-Prefix.pch -MMD -MT dependencies -MF /Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AdjustCordova.d --serialize-diagnostics /Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AdjustCordova.dia -c /Users/<user>/Development/20/<ProjectName>/platforms/ios/<ProjectName>/Plugins/com.adjust.sdk/AdjustCordova.m -o /Users/<user>/Development/20/<ProjectName>/platforms/ios/build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AdjustCordova.o
In file included from /Users/<user>/Development/20/<ProjectName>/platforms/ios/<ProjectName>/Plugins/com.adjust.sdk/AdjustCordova.m:9:
/Users/<user>/Development/20/<ProjectName>/platforms/ios/<ProjectName>/Plugins/com.adjust.sdk/AdjustCordova.h:9:9: fatal error: 'Cordova/CDV.h' file not found
#import <Cordova/CDV.h>
^
1 error generated.
... ////////// This error happens multiple times.
/Users/<user>/Development/20/<ProjectName>/platforms/ios/<ProjectName>/Plugins/com.aquto.cordova.AppleAdvertising/AppleAdvertising.h:2:9: fatal error: 'Cordova/CDV.h' file not found
#import <Cordova/CDV.h>
^
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AdjustCordova.o <ProjectName>/Plugins/com.adjust.sdk/AdjustCordova.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/APPLocalNotification.o <ProjectName>/Plugins/de.appplant.cordova.plugin.local-notification/APPLocalNotification.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/CDVConnection.o <ProjectName>/Plugins/org.apache.cordova.network-information/CDVConnection.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/CDVAssetLibraryFilesystem.o <ProjectName>/Plugins/org.apache.cordova.file/CDVAssetLibraryFilesystem.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AppDelegate.o <ProjectName>/Classes/AppDelegate.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/CDVLocalFilesystem.o <ProjectName>/Plugins/org.apache.cordova.file/CDVLocalFilesystem.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/CDVDevice.o <ProjectName>/Plugins/org.apache.cordova.device/CDVDevice.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/<ProjectName>.build/Release-iphonesimulator/<ProjectName>.build/Objects-normal/i386/AppleAdvertising.o <ProjectName>/Plugins/com.aquto.cordova.AppleAdvertising/AppleAdvertising.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(8 failures)
No I run the command with the workspace set up and the scheme as well.
SebastiansMBP2:ios <user>$ xcodebuild -arch i386 -sdk iphonesimulator8.0 -workspace <ProjectName>.xcodeproj/project.xcworkspace -scheme <ProjectName>
Build settings from command line:
ARCHS = i386
SDKROOT = iphonesimulator8.0
=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===
Check dependencies
2014-10-21 11:44:44.905 xcodebuild[67925:365372] DeveloperPortal: Using pre-existing current store at URL (file:///Users/<user>/Library/Developer/Xcode/DeveloperPortal%206.0.db).
=== BUILD TARGET <ProjectName> OF PROJECT <ProjectName> WITH CONFIGURATION Debug ===
Check dependencies
....
** BUILD SUCCEEDED **
Now I run the generated build on an ios-sim:
SebastiansMBP2:ios <user>$ ios-sim launch /Users/<user>/Development/20/<ProjectName>/platforms/ios/build/Release-iphonesimulator/<ProjectName>.app
Session could not be started: Error Domain=LaunchServicesError Code=0 "Unable to run app in Simulator" UserInfo=0x7f8993721ad0 {Error=ExecutableTwiddleFailed, ErrorDescription=Failed to chmod file:///Users/<user>/Library/Developer/CoreSimulator/Devices/B745FCEF-0713-419B-B5EF-5274C912DA7E/data/Library/Caches/com.apple.containermanagerd/Temp/Bundle/Application/D615484C-04F7-496D-AB61-4A988E4357C3/<ProjectName>.app/<ProjectName> : No such file or directory, NSLocalizedFailureReason=An error was encountered while running (Domain = LaunchServicesError, Code = 0), NSUnderlyingError=0x7f8993415850 "The operation couldn’t be completed. (LaunchServicesError error 0.)", NSLocalizedDescription=Unable to run app in Simulator}
(username, project name and other privacy related parts have been replaced)
Do you have any ideas how to fix this and how to build a version that can be used to upload it to Facebook?
I'm running Xcode 6, updated the ios-sim to version 3.0.0 and updated cordova-cli to version 4.0.0 with the iOS platform version 3.6.3.
Building the application via cordova build iOS and via Xcode directly works fine!
Thanks!
Just as an information for you guys, I was able to solve it by running the application from Xcode and then just zipping the content of the iOS/build/Emulator/ folder.
The biggest difference between both is, that the mentioned folder contains a separate library libCordova.a and a folder include. With this two elements I was able to hand the iOS application in to Facebook (I just added them to the ZIP-File).
Hope this helps you ;)
I had the same issue, and was related to the cordova-ios version. I had to upgrade it, and then it solved the issue. Cordova-ios with problem was 4.3.0

Using HP Fortify and Xcode

I'm having this issue... after successfuly building an iOS 6.0 (Xcode 4.5) project separately using xcodebuild, the sourceanalyzer first reports missing .nst files for couple classes including stdarg.h and similar. Seems like sourceanalyzer cannot see the iPhone SDK's Header Search Paths. However Fortify seems so rare, that I haven't spotted any answer yet, especially regards to compatibility with various Xcode versions, etc. Anyone?
$ sourceanalyzer -b Forty xcodebuild -configuration Debug -sdk iphoneos6.1
Output:
Build settings from command line:
SDKROOT = iphoneos6.1
=== BUILD NATIVE TARGET fortifyTest OF PROJECT fortifyTest WITH CONFIGURATION Debug ===
Check dependencies
ProcessPCH /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.pth fortifyTest/fortifyTest-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/sychram/Repositories/fortifyTest
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Applications/HP_Fortify/HP_Fortify_SCA_and_Apps_3.70/bin"
/Users/sychram/.fortify/sca5.14/build/Forty/build717537620538182813/clang -x objective-c-header -arch armv7 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -miphoneos-version-min=6.0 -iquote /Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-generated-files.hmap -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-own-target-headers.hmap -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-all-target-headers.hmap -iquote /Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/fortifyTest-project-headers.hmap -I/Users/sychram/Repositories/fortifyTest/build/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/DerivedSources/armv7 -I/Users/sychram/Repositories/fortifyTest/build/fortifyTest.build/Debug-iphoneos/fortifyTest.build/DerivedSources -F/Users/sychram/Repositories/fortifyTest/build/Debug-iphoneos --serialize-diagnostics /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.dia -c /Users/sychram/Repositories/fortifyTest/fortifyTest/fortifyTest-Prefix.pch -o /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.pth -MMD -MT dependencies -MF /var/folders/yp/2l8w2hpd08199zstwqnxnvs80000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/fortifyTest-Prefix-gfjvmaafdrnknjehmxvutbaqdpny/fortifyTest-Prefix.pch.d
[error]: Translator execution failed. Please consult the Troubleshooting section of the User Manual.
Translator returned status 1:
In file included from /Users/sychram/Repositories/fortifyTest/fortifyTest/fortifyTest-Prefix.pch:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/sys/types.h:78:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/machine/types.h:35:10: fatal error: 'i386/types.h' file not found
#include "i386/types.h"
^
1 error generated.
AFAIK only xcode versions 4.1, 4.2, 4.2.1, 4.3 are supported by fortify in the latest release 3.7.
Currently there is support for xcode 4.6 with SCA version 4.02. But I am still waiting for xcode 5.x to support by fortify, that I will be able to scan apps based on iOS7. since february apps submitted to the App Store must be built with the latest version of Xcode 5 and must be optimized for iOS 7.

invalid value '' in '-std=' when switch from GCC 4.2 to LLVM 2.0

I'd like to change from using GCC version 4.2 to LLVM version 2.0 in XCode4.
When I change the compiler flag to to LLVM I get an error: invalid value '' in '-std='. Was having it in the *_prefix.pch file, but after turning off the GCC_Precompile_prefix_header the error moved to a new point in my code.
The initial value use seems to refer to an empty string.
What's going on here.
The full error message is below.
Many thanks
CompileC /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/Objects-normal/i386/GameViewController.o Classes/GameViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/cram/Projects/MightyMemory
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std= -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fvisibility=hidden -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -iquote /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-generated-files.hmap -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-own-target-headers.hmap -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-all-target-headers.hmap -iquote /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/MightyMemory-project-headers.hmap -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Products/Debug-iphonesimulator/include -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/DerivedSources/i386 -I/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/DerivedSources -F/Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Products/Debug-iphonesimulator -include /Users/cram/Projects/MightyMemory/MaxMemory_Prefix.pch -c /Users/cram/Projects/MightyMemory/Classes/GameViewController.m -o /Users/cram/Library/Developer/Xcode/DerivedData/MightyMemory-cceuiavwfpmibiczfvlodqgugfnb/Build/Intermediates/MightyMemory.build/Debug-iphonesimulator/MightyMemory.build/Objects-normal/i386/GameViewController.o
error: invalid value '' in '-std='
I solved the problem. For the next person to run up against this: It turns out that the options that were passed to the compiler were incorrect; not that I changed them from what they were when using gcc. The error was that the GCC_C_LANGUAGE_STANDARD was not set, i.e. the argument that XCode4 put is was '' (a blank string). I set it to compiler default and all was good.

Resources