I am writing an appcelerator module to use my own sqlite3 build. The problem that I am facing is that the default system sqlite code seems to get linked regardless.
I have tried a number of things, but I would have throught that placing all the sqlite code in my .m file would result in that code being called.
MySqlite.m
#import "sqlite3.h"
#import "sqlite3.c"
#pragma Public APIs
-(NSString *)getSqliteVersion:(id)args
{
return [NSString stringWithFormat:#"%s", sqlite3_libversion()];
}
The getSqliteVersion member still returns version number of the iOS standard sqlite library
So does anyone know how to alter the linker to pick up my own sqlite code or is there a way to "wrap" the sqlite in a namespace or such like?
EDIT 10/10/12:
Sorry, bit more info that is relevant. The build process is two steps.
The part I am doing is to build the module which is a packaged static library, i.e. a .a file
This .a file is distributed to other users and then they build their application with this module. So that is why I can't control the second linking step and remove any .dylib sqlite references.
Some how I think I need to get my sqlite lib into a private "namespace". I use namespace conceptually, I know C doesn't have them
Not sure if it helps, but the Ti build commands for the module build seem to be:
Build settings from command line:
SDKROOT = iphonesimulator5.0
=== BUILD NATIVE TARGET tisqlite_crypt_ios OF PROJECT tisqlite_crypt_ios WITH CONFIGURATION Release ===
Check dependencies
CompileC build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.o Classes/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /TitaniumStudioWorkspace/tisqlite_crypt_ios
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/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=c99 -Wno-trigraphs -fpascal-strings -Os -Wno-return-type -Wno-parentheses -Wswitch -Wunused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-shorten-64-to-32 -DTI_VERSION= -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -Wno-sign-conversion -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=40000 -iquote /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-generated-files.hmap -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-own-target-headers.hmap -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-all-target-headers.hmap -iquote /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-project-headers.hmap -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator/include "-I/Library/Application Support/Titanium/mobilesdk/osx/2.1.3.GA/iphone/include" "-I/Library/Application Support/Titanium/mobilesdk/osx/2.1.3.GA/iphone/include/TiCore" -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/DerivedSources/i386 -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/DerivedSources -F/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator -DTI_POST_1_2 -include /var/folders/LP/LPsQmql2FfCGO9YCrCUKUU+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios_Prefix-hbaweqhgijjnfpfynapljpziqmjk/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios_Prefix.pch -MMD -MT dependencies -MF /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.d -c /TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.m -o /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.o
In file included from /TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.m:14:
/TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/sqlite3.c:27620:32:{27620:32-27620:45}{27620:30-27620:31}: warning: implicit conversion from 'long long' to 'long' changes value from 9223372036854775807 to -1 [-Wconstant-conversion,3]
mask = (sizeof(long)==8) ? LARGEST_INT64 : 0x7fffffff;
~ ^~~~~~~~~~~~~
/TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/sqlite3.c:7946:25: note: instantiated from:
#define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Libtool build/Release-iphonesimulator/libUkCoClinicalsoftwaresolutionsTisqlite_crypt_ios.a normal i386
cd /TitaniumStudioWorkspace/tisqlite_crypt_ios
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/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/libtool -static -arch_only i386 -syslibroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator -filelist /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios.LinkFileList -ObjC -framework Foundation -o /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator/libUkCoClinicalsoftwaresolutionsTisqlite_crypt_ios.a
** BUILD SUCCEEDED **
Related
In one of my projects I'm using git submodules to download the SDL2 Library and compile it. This is giving me a strange error so I tried to compile SDL2 Standalone and I got the same error.
I'm on a 13" MacBook Pro Big Sur
Steps to reproduce:
git clone https://github.com/libsdl-org/SDL.git
cd SDL
cmake . -Bbuild
make -C ./build
The error I get is
In file included from /Users/<user>/Documents/side side projects/neural networks/libs/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m:24:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
~~~~~~~~~~~~~~ ^ ~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
#define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
^ ~
1 error generated.
make[2]: *** [libs/SDL/CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o] Error 1
make[1]: *** [libs/SDL/CMakeFiles/SDL2.dir/all] Error 2
make: *** [all] Error 2
The message would imply that Apple's own SDK files don't compile, but that can't be right. What's even stranger is that I'm using git submodules with SDL2 in another project but that compiles successfully and I can't find any discernible difference between this and the other project.
Edit:
I user make -C ./build VERBOSE=1 to compare the output with the project that successfully compiled and the project that failed to compile.
Successfully compiled:
[ 0%] Building C object libs/SDL/CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o
cd "/Users/<user>/Documents/side side projects/Legion/build/libs/SDL" && /usr/local/opt/llvm/bin/clang -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -I"/Users/<user>/Documents/side side projects/Legion/build/libs/SDL/include" -I"/Users/<user>/Documents/side side projects/Legion/libs/SDL/include" -g -O3 -idirafter "/Users/<user>/Documents/side side projects/Legion/libs/SDL/src/video/khronos" -D_THREAD_SAFE -msse3 -msse2 -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall -fPIC -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -o CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o -c "/Users/<user>/Documents/side side projects/Legion/libs/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m"
Take note of: -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks
Failed to compile:
[ 0%] Building C object CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o
/usr/local/opt/llvm/bin/clang -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -I/Users/<user>/Desktop/SDL-main/build/include -I/Users/<user>/Desktop/SDL-main/include -idirafter "/Users/<user>/Desktop/SDL-main/src/video/khronos" -I/usr/local/Cellar/libusb/1.0.24/include/libusb-1.0 -D_THREAD_SAFE -msse3 -msse2 -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -mmacosx-version-min=11.5 -fPIC -o CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o -c /Users/<user>/Desktop/SDL-main/src/file/cocoa/SDL_rwopsbundlesupport.m
Take note of: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk
The only difference between the successfully compiled project and the project that failed to compile is the MacOS SDK version. The one that failed to compile used MacOS SDK 12 while the successful one used MacOS 11.3. Until this is fixed a temporary solution is to downgrade your MacOS SDK to 11.3.
I created a static library in Objective C (for OSX) for performing some calculations. I then compiled it and included it in another project. Later on I'm not able to use it in my codes.
1> When I wrote
import "Auth.h"
it was giving me a File Not Found error. Why is it so?
2> Then I had to set the search path to the source of the libraries and it got compiled and executed correctly. Does that mean I can't reuse the compiled library with other projects without distributing the source code along with it?
3> I thought if Search path is being specified then the compiled library won't need to be needed. So I deleted the library. But that didn't work. It means source + the library both are required.
What is actually happenning. I just want to distribute libAuth.a with other teams for the project without giving out the source. How can I do that.
You just need to provide the library file (.a) and the header files; the source files can remain private and undistributed.
Be sure to compile the library for all architectures (x86_64 and i386 on OSX) that can possibly use the library, using lipo to create a fat binary .a file.
For example:
xcrun --sdk macosx10.8 clang -arch x86_64 -o file1.o file1.m
xcrun --sdk macosx10.8 clang -arch x86_64 -o file2.o file2.m
xcrun --sdk macosx10.8 libtool -static -arch_only x86_64 -o libmystuff_x86_64.a file1.o file2.o
xcrun --sdk macosx10.8 clang -arch i386 -o file1.o file1.m
xcrun --sdk macosx10.8 clang -arch i386 -o file2.o file2.m
xcrun --sdk macosx10.8 libtool -static -arch_only i386 -o libmystuff_i386.a file1.o file2.o
xcrun --sdk macosx10.8 lipo -arch x86_64 libmystuff_x86_64.a -arch i386 libmystuff_i386.a -create -output libmystuff.a
Try adding the followings in your main project target settings;
”-ObjC” and ”-all_load” to Build Settings > Linking > Other Linker Flags,
”$(TARGET_BUILD_DIR)/usr/local/lib/include” and ”$(OBJROOT)/UninstalledProducts/include” to Build Settings > Search Paths > Header Search Paths,
"$(BUILT_PRODUCTS_DIR)" to Build Settings > User Header Search Paths.
Im trying to compile a mach-o arm object file to mach-o arm executable using the command line. I have used various commands like these
clang -arch armv7 helloapp.o -o helloapp
clang helloapp.o -o helloapp
gcc helloapp.o -o helloapp
They all return different errors saying compiling for wrong architecture or missing neccessary files. What is the command I need to compile this properly??
The default compilers (the ones in your $PATH) reference the ones that can compile for your local machine. You need a cross-compiler that knows how to create ARM binaries. If you've got Xcode with iOS SDK installed you can use for example:
PATH_TO_Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
or
PATH_TO_Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
For example, on my machine:
ARM_GCC=~/Documents/Xcode4.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
IOS_SDK=~/Documents/Xcode4.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
# Compile
$ARM_GCC -arch armv7 -c test.c -o test.o
# Link
$ARM_GCC -arch armv7 -isysroot "$IOS_SDK" test.o -o test
If I then run file test I get:
test: Mach-O executable arm
I faced following error while compiling main.m (Objective-C)
I am using makefile to build this file.
/Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -Wall -DDEBUG=1 -g -o main.o main.m -mmacosx-version-min=10.8 -F/Volumes/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/
In file included from main.m:9:
In file
included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:138:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:7:
/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:64:10: fatal error:
'ImageIO/ImageIO.h' file not found
#include <ImageIO/ImageIO.h>
^
1 error generated.
make: *** [main.o] Error 1
I do not know why this ImageIO/ImageIO.h is not found. What is the reason behind this?
Additionally I would like to know how to make Clang to look into the Frameworks present in /Volumes/Xcode.app/Contents/Developer/ (specified in option -F)?
It sounds like you're trying to build against the OS X 10.8 SDK from the command-line. The compiler invocation you're after will look something like so:
xcrun clang -arch x86_64 -Wall -DDEBUG=1 -g -o main.o main.m -mmacosx-version-min=10.8 -isysroot $(xcodebuild -version -sdk macosx10.8 Path)
The -isysroot argument to clang tells it to treat the given path as the root of the system with respect to the default header and framework search paths.
I'm trying to create a Cocoa framework by using a cross-project reference in Xcode.
I have 2 projects: one for the framework; one for the application that will use the framework.
This framework is not intended to be stored within the system; it is an embedded framework that lives within the application bundle.
I have successfully made the cross-project reference, marked the framework as being a dependency of my target, added a Copy Files build phase that puts the framework in Contents/Frameworks/ and added the framework to the linker phase (I checked the little "Target" checkbox; I've also done it manually by dragging the framework into the linker phase).
My framework's install directory is correctly set to #executable_path/../Frameworks.
However, when I try to build my app it:
a) Correctly builds the framework first
b) Correctly copies the framework
c) Errors because it cannot find the master header file in my framework
I have verified that the header is there. I can see it in the app product that is partially built.
ls build/Debug/CioccolataTest.webapp/Contents/Frameworks/Cioccolata.framework/Headers/Cioccolata.h
build/Debug/CioccolataTest.webapp/Contents/Frameworks/Cioccolata.framework/Headers/Cioccolata.h
I have been able to successfully build the app by copying my framework into /Library/Frameworks (I can then delete it again after the successful build), but this is a workaround, I'm looking to find it out why Xcode doesn't find the framework's master header file without it being copied to a system directory. Is copying it to the app bundle during the build not sufficient?
Here's the full build transcript if it's any help (it's just a Hello World app right now, so not much going on here):
Build Cioccolata of project Cioccolata with configuration Debug
SymLink /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/Current A
cd /Users/chris/Projects/Mac/Cioccolata
/bin/ln -sf A /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/Current
SymLink /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Resources Versions/Current/Resources
cd /Users/chris/Projects/Mac/Cioccolata
/bin/ln -sf Versions/Current/Resources /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Resources
SymLink /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Headers Versions/Current/Headers
cd /Users/chris/Projects/Mac/Cioccolata
/bin/ln -sf Versions/Current/Headers /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Headers
SymLink /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Cioccolata Versions/Current/Cioccolata
cd /Users/chris/Projects/Mac/Cioccolata
/bin/ln -sf Versions/Current/Cioccolata /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Cioccolata
ProcessInfoPlistFile /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Resources/Info.plist Info.plist
cd /Users/chris/Projects/Mac/Cioccolata
builtin-infoPlistUtility Info.plist -expandbuildsettings -platform macosx -o /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Resources/Info.plist
CpHeader build/Debug/Cioccolata.framework/Versions/A/Headers/CWHelloWorld.h CWHelloWorld.h
cd /Users/chris/Projects/Mac/Cioccolata
/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Users/chris/Projects/Mac/Cioccolata/CWHelloWorld.h /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Headers
CpHeader build/Debug/Cioccolata.framework/Versions/A/Headers/Cioccolata.h Cioccolata.h
cd /Users/chris/Projects/Mac/Cioccolata
/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Users/chris/Projects/Mac/Cioccolata/Cioccolata.h /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Headers
CopyStringsFile /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Resources/English.lproj/InfoPlist.strings English.lproj/InfoPlist.strings
cd /Users/chris/Projects/Mac/Cioccolata
setenv ICONV /usr/bin/iconv
/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings --validate --inputencoding utf-8 --outputencoding UTF-16 English.lproj/InfoPlist.strings --outdir /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Resources/English.lproj
ProcessPCH /var/folders/Xy/Xy-bvnxtFpiYBQPED0dK1++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Cioccolata_Prefix-dololiigmwjzkgenggebqtpvbauu/Cioccolata_Prefix.pch.gch Cioccolata_Prefix.pch normal i386 objective-c com.apple.compilers.gcc.4_2
cd /Users/chris/Projects/Mac/Cioccolata
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch i386 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.5.sdk -mfix-and-continue -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-generated-files.hmap -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-own-target-headers.hmap -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-all-target-headers.hmap -iquote /Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-project-headers.hmap -F/Users/chris/Projects/Mac/Cioccolata/build/Debug -I/Users/chris/Projects/Mac/Cioccolata/build/Debug/include -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/DerivedSources/i386 -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/DerivedSources -c /Users/chris/Projects/Mac/Cioccolata/Cioccolata_Prefix.pch -o /var/folders/Xy/Xy-bvnxtFpiYBQPED0dK1++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Cioccolata_Prefix-dololiigmwjzkgenggebqtpvbauu/Cioccolata_Prefix.pch.gch
CompileC build/Cioccolata.build/Debug/Cioccolata.build/Objects-normal/i386/CWHelloWorld.o /Users/chris/Projects/Mac/Cioccolata/CWHelloWorld.m normal i386 objective-c com.apple.compilers.gcc.4_2
cd /Users/chris/Projects/Mac/Cioccolata
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.5.sdk -mfix-and-continue -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-generated-files.hmap -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-own-target-headers.hmap -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-all-target-headers.hmap -iquote /Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Cioccolata-project-headers.hmap -F/Users/chris/Projects/Mac/Cioccolata/build/Debug -I/Users/chris/Projects/Mac/Cioccolata/build/Debug/include -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/DerivedSources/i386 -I/Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/DerivedSources -include /var/folders/Xy/Xy-bvnxtFpiYBQPED0dK1++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Cioccolata_Prefix-dololiigmwjzkgenggebqtpvbauu/Cioccolata_Prefix.pch -c /Users/chris/Projects/Mac/Cioccolata/CWHelloWorld.m -o /Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Objects-normal/i386/CWHelloWorld.o
Ld /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Cioccolata normal i386
cd /Users/chris/Projects/Mac/Cioccolata
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/gcc-4.2 -arch i386 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/chris/Projects/Mac/Cioccolata/build/Debug -F/Users/chris/Projects/Mac/Cioccolata/build/Debug -filelist /Users/chris/Projects/Mac/Cioccolata/build/Cioccolata.build/Debug/Cioccolata.build/Objects-normal/i386/Cioccolata.LinkFileList -install_name #executable_path/../Frameworks/Cioccolata.framework/Versions/A/Cioccolata -mmacosx-version-min=10.5 -framework Foundation -single_module -compatibility_version 1 -current_version 1 -o /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework/Versions/A/Cioccolata
Touch /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework
cd /Users/chris/Projects/Mac/Cioccolata
/usr/bin/touch -c /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework
Build CioccolataTest of project CioccolataTest with configuration Debug
ProcessInfoPlistFile /Users/chris/Projects/Mac/CioccolataTest/build/Debug/CioccolataTest.webapp/Contents/Info.plist Info.plist
cd /Users/chris/Projects/Mac/CioccolataTest
builtin-infoPlistUtility Info.plist -expandbuildsettings -platform macosx -o /Users/chris/Projects/Mac/CioccolataTest/build/Debug/CioccolataTest.webapp/Contents/Info.plist
PBXCp build/Debug/CioccolataTest.webapp/Contents/Frameworks/Cioccolata.framework /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework
cd /Users/chris/Projects/Mac/CioccolataTest
/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Users/chris/Projects/Mac/Cioccolata/build/Debug/Cioccolata.framework /Users/chris/Projects/Mac/CioccolataTest/build/Debug/CioccolataTest.webapp/Contents/Frameworks
CopyStringsFile /Users/chris/Projects/Mac/CioccolataTest/build/Debug/CioccolataTest.webapp/Contents/Resources/English.lproj/InfoPlist.strings English.lproj/InfoPlist.strings
cd /Users/chris/Projects/Mac/CioccolataTest
setenv ICONV /usr/bin/iconv
/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings --validate --inputencoding utf-8 --outputencoding UTF-16 English.lproj/InfoPlist.strings --outdir /Users/chris/Projects/Mac/CioccolataTest/build/Debug/CioccolataTest.webapp/Contents/Resources/English.lproj
CompileC build/CioccolataTest.build/Debug/CioccolataTest.build/Objects-normal/i386/main.o main.m normal i386 objective-c com.apple.compilers.gcc.4_2
cd /Users/chris/Projects/Mac/CioccolataTest
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.5.sdk -mfix-and-continue -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/CioccolataTest-generated-files.hmap -I/Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/CioccolataTest-own-target-headers.hmap -I/Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/CioccolataTest-all-target-headers.hmap -iquote /Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/CioccolataTest-project-headers.hmap -F/Users/chris/Projects/Mac/CioccolataTest/build/Debug -I/Users/chris/Projects/Mac/CioccolataTest/build/Debug/include -I/Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/DerivedSources/i386 -I/Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/DerivedSources -include /Users/chris/Projects/Mac/CioccolataTest/prefix.pch -c /Users/chris/Projects/Mac/CioccolataTest/main.m -o /Users/chris/Projects/Mac/CioccolataTest/build/CioccolataTest.build/Debug/CioccolataTest.build/Objects-normal/i386/main.o
In file included from <command-line>:0:
/Users/chris/Projects/Mac/CioccolataTest/prefix.pch:13:35: error: Cioccolata/Cioccolata.h: No such file or directory
/Users/chris/Projects/Mac/CioccolataTest/main.m: In function 'main':
/Users/chris/Projects/Mac/CioccolataTest/main.m:13: error: 'CWHelloWorld' undeclared (first use in this function)
/Users/chris/Projects/Mac/CioccolataTest/main.m:13: error: (Each undeclared identifier is reported only once
/Users/chris/Projects/Mac/CioccolataTest/main.m:13: error: for each function it appears in.)
/Users/chris/Projects/Mac/CioccolataTest/main.m:13: error: 'hello' undeclared (first use in this function)
I know this post is old now, but I'm working on another project and have just had the displeasure of setting up another cross-project reference for an embedded framework that must be built from a separate project before building this project.
I came up with a much more elegant fix (and probably the "correct" fix) this time, basically because what I did last time wasn't working (Xcode kept complaining that it couldn't find the framework's main header file).
The solution. I've just tested it on a number of projects from scratch just to be sure...
Add the other (dependency) project to your main project by doing "Project -> Add to project"
Double click on your target that requires products from the other project.
In the general tab, add the required products as direct dependencies (top panel). Close this settings panel.
Drag the product from the cross-project reference into the Link Binary with Libraries build phase of your target.
Add a new "Copy Files" build phase, selecting "Products" as the destination directory (!!!). Rename this build phase to "Copy Cross-Project Products".
Drag your cross-project product(s) into this new build phase and make sure that it's the first build phase in your target.
Add one final "Copy Files" build phase to your target, selecting "Frameworks" as the destination.
Drag your cross-project product(s) into this new build phase.
While it looks long-winded, most of it is pretty normal and exactly what you'd do if the dependency target was in the same project. The crucial first build phase however needs to copy the built products from the other project into the current project's build directory.
Obviously Xcode is smart enough to get the other project to perform the build, but not smart enough to think to look there when it starts compiling your sources that depend on it.
Does your 'Framework Search Paths' build setting include the path to the framework?