iOS Linker Command Failed using Core Plot Xcode 4.3.2 - objective-c

So I'm building an application with CorePlot, and when I tried to run it i got the following errors:
ld: warning: ignoring file /Users/tcbl/Library/Developer/Xcode/DerivedData/FaceTracker- chbhtqlxwipamtailjamrakmkpuy/Build/Products/Debug-iphoneos/libCorePlot-CocoaTouch.a,
file was built for archive which is not the architecture being linked (armv6)
ld: duplicate symbol _main in /Users/tcbl/Library/Developer/Xcode/DerivedData/FaceTracker-chbhtqlxwipamtailjamrakmkpuy/Build/Intermediates/FaceTracker.build/Debug-iphoneos/FaceTracker.build/Objects-normal/armv6/main-cocoatouch.o and /Users/tcbl/Library/Developer/Xcode/DerivedData/FaceTracker-chbhtqlxwipamtailjamrakmkpuy/Build/Intermediates/FaceTracker.build/Debug-iphoneos/FaceTracker.build/Objects-normal/armv6/main.o for architecture armv6
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I read somewhere that I need to add to other linker flags: -ObjC -all_load -lCorePlot But this doesn't seem to be anywhere in the project info or build settings, and I'm not sure if this even has anything to do with my error. Any help demystifying this would be much appreciated.

If you select your project and go to the Build Settings tab, you should find it listed under Linking. Make sure you have the advanced/complete view of the tab. The field you want to enter those under is "Other Linker Flags".
Hope that helps!

Related

Duplicate symbols for architecture arm64 -objc

I added some .m, .h files(include xxxController.m, xxxController.h) and libraries(include abc.a) to my xcode project same as the sample project which runs very well but this error occured:
duplicate symbol 'OBJC_IVAR$xxxController.xxx' in:
/Users/xxx/Library/Developer/Xcode/DerivedData/xxx/Build/Intermediates.noindex/xxx.build/Debug-iphoneos/xxx.build/Objects-normal/arm64/xxxController.o
../lib/xxx/lib/abc.a(xxx.o) ld: 15 duplicate symbols for architecture
arm64 clang: error: linker command failed with exit code 1 (use -v to
see invocation)
I changed enable testability option and no common blocks option to NO but still fail to build.
Also there are no duplicates in the compile source and removing derived data or cleaning build folder didn't work for me.
And when I remove '-Objc' in Other Linker Flags, it occurs 'Undefined symbol: OBJC_CLASS$_FIRInstallations' error. How can I fix it?

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?

iOS 9 specific linker error with respect to WebKit.framework

I am receiving the following linker error on iOS 9 and above. I am stuck with this issue for quite sometime. Any help would be appreciable.
ld: file not found: /System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have fixed this issue my removing WebKit.framework from the project's file system and again adding it only thru Build phases.

wxWidgets 2.9.4 + Xcode 4.5.2 - Can't make it work

I'm having troubles trying to use wxWidgets 2.9.4 and Xcode 4.5.2, I get all sort of errors in the way.
First of all, I think I installed wxWidgets correctly, because every sample and demo run just fine. The problem is when I try to create an Xcode project.
When I follow the wxWidgets tutorial changing the build settings as follows:
Paste the --cppflags in "Other C++ Flags"
Paste the --libs in "Other Linker Flags" (REMOVING THE -L)
Change the compiler to GCC
I get:
ld: library not found for -lwxregexu-2.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I follow the http://zebratale.tumblr.com tutorial (seems more detailed to me)
I get:
ld: library not found for -lwx_osx_cocoau_xrc-2.9
clang: error: linker command failed with exit cod 1 (use -v to see invocation)
I'm completely lost and I'd appreciate any help
------------UPDATE------------------------
I just found out that it's possible to compile it using the terminal command:
g++ -o main main.cpp './../../build-cocoa-debug/wx-config --debug --cxxflags --libs'
So I guess the problem is the compiler Xcode is using. But when I change it to LLMV GCC 4.2, I get the same error (YES, as if it was still using clang)
To change the compiler I went to build settings->build options->compiler for c/c++/objective-c and changed it.
---------UPDATE2-----------------
Even now that I changed the compiler on Xcode the error is:
ld: library not found for -lwx_osx_cocoau_xrc-2.9
collect2: ld returned 1 exit status
Command /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
First, use --cxxflags (C++ compiler flags), not --cppflags (C preprocessor flags).
Second, why do you remove -L? Of course the linker can't find the libraries if you remove the option telling it where they are.

How to see invocation in Xcode

I'have got an error in build.
Xcode return
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Do you know how can i launch build with -v to see invocation ?
In Xcode click on 'View', 'Navigators' and 'Show Report Navigator' then click on the build that failed. In the listing of the build steps you will see your 'use -v to see invocation' - to the right click on the disclosure icon (next to the error icon).
Doing that will show the details of the linker invocation.
Of course, the actual problem is that you are building an executable without including the file that contains 'main'. Usually one is created for you and automatically included - based on the target. If you are making a target yourself; you'll need main() implemented somewhere.
You can add the -v to the "Other Linker Flags" field in the project settings. Doing so in a test project here yields the complete linker invocation:
when you add -v to "Other Linker Flags" you will get more information, this is the different between add before and add behind