Does OS matter when compiling for iPhone? - iphone-sdk-3.0

I fairly new on iPhone development and I'm currently trying to add some static libraries to my project but I get the "Symbol(s) not found" error.
I've googled the issue and tried different solutions without any luck. The libraries are compiled on a PC and not on a Mac so my questions are:
Do I need to compile the code on a Mac?
What tool(s) do I need to be able to compile them?
I have included the headers to the project. The code I'm trying to link to are written in c and are compiled for ARM GCC 4.2.
I get the following errorcode:
ld warning: in /Users/<>/Playground/Collage/libbaseapi.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/capseng.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/excodecs.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmautorama.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmclearshot.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmexif.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmextencoder.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmfacewarp.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmfxplugin.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmimageenhance.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmimagefusion.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmjpegsqueeze.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmjpegtools.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmphotoart.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmredaway.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmsemc.a, file is not of required architecture
ld warning: in /Users/<>/Playground/Collage/fmspeedview.a, file is not of required architecture
Undefined symbols:
"_caps_destroyBuffer", referenced from:
-[CollageMainView drawRect:] in CollageMainView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
"_caps_destroyBuffer", referenced from:
-[CollageMainView drawRect:] in CollageMainView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (1 error)
BR,
Andreas

You can't add custom (compiled) libraries to an iPhone application. You should always include the source code in your project.

You need to either add the header files for your libraries to your project,
or if it's a missing framework, add it to the "frameworks" folder in Xcode.

Related

_OBJC_CLASS_$_ShellTask error on objective-c project

I am getting this error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ShellTask", referenced from:
objc-class-ref in PhoneLocator.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Architectures of my target is $(ARCHS_STANDARD)
I have checked online throughout day :(. But I didn't get any solution. How can I resolve this issue.
_OBJC_CLASS_$_ShellTask this error means ShellTask this the file name. When you getting these sort of error it means that the file is missing under your compile sources. Just add that file the error will be gone
In target -> Build Phases -> Compile Sources I had all .m files including those that were giving issue.

Same library included from two libraries

I get error:
ld: 24 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
because I have two libraries that both use GTMLogger.o.
/Users/***/Library/Developer/Xcode/DerivedData/project-name/Build/Products/Debug-iphoneos/GoogleToolboxForMac/libGoogleToolboxForMac.a(GTMLogger.o)
/Users/***/project-name/Libraries/Framework/Framework.framework/Framework(GTMLogger.o)
One library is included as cocoapod and the other is included manually. Second library cant be included as cocoapod.
I need both libraries and just want to know is there a way to solve this?

"_TWTRScribeEventImpressionElement" and TwitterKit Objective C

I'm using Xcode 7.
After updating Fabric framework and TwitterCore I can't build my project. I Have problem with _TWTRScribeEventImpressionElement and other files in TwitterKit.
I'm tryied to update TwitterKit but it did not help.
Error is:
Undefined symbols for architecture armv7:
"_TWTRScribeEventImpressionElement", referenced from:
-[TWTRScribeSink didShareTweetWithID:shareType:] in TwitterKit(TWTRScribeSink.o)
+[TWTRScribeSink tweetLoadNamespace] in TwitterKit(TWTRScribeSink.o)
+[TWTRScribeSink tweetViewImpressionNamespaceWithStyle:] in TwitterKit(TWTRScribeSink.o)
+[TWTRScribeSink tweetViewShareNamespace] in TwitterKit(TWTRScribeSink.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Has somebody seen such problem?

j2objc Compile error: Undefined symbols for architecture arm64:

i get the following error when i run j2objcc -o blssmibi BLSSMIBI.o
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Curve", referenced from:
objc-class-ref in BLSSMIBI.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
what should i do to fix this?
There's no Curve class anywhere in j2objc's libraries, so my guess it's a dependency from the Java file that you used to generate BLSSMIBI (maybe that's the it looks like a package prefix was used). If you aren't sure what a class's dependencies are, try compiling with javac to a temporary directory and see what name.class files are created (ignore the ones with $ in their names, as they're inner classes). That list of class files is used to figure out all the classes that need transpiling, as well as all the .o files that the app requires.

objective C Undefined symbols for architecture i386: "_secTrustEvaluate"

I am try to check if the phone has a configuration profile is installed on an iPhone using this tutorial
I encountered the following issue , when I wrote this line :
err = secTrustEvaluate (trust,&trustResult);
I get the following warning
implicit declaration of function 'secTrustEvaluate' is invalid in C99
and I get the following erros when I try to build
Undefined symbols for architecture i386:
"_secTrustEvaluate", referenced from:
-[<Class name> <function name>] in <class object.o>
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also included the Security.framework Framework (which removed several issues similar to this one)
any reason why this is not working ?
Thanks!