Same library included from two libraries - objective-c

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?

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?

duplicate symbols for architecture x86_64 when import LWIMKIT.framwork

Project use swift. And after importing this LWIMKIT.framwork, I faced duplicate symbols problem.
duplicate symbol _OBJC_CLASS_$_DDTTYLoggerColorProfile in:
/Users/Arain/Library/Developer/Xcode/DerivedData/Taoji-aldpdybccvcoflbbrtplhgqzroqp/Build/Intermediates/Taoji.build/Debug-iphonesimulator/Taoji.build/Objects-normal/x86_64/DDTTYLogger.o
/Users/Arain/Desktop/ARAIN_PRO/develop/Taoji/LWIMKIT.framework/LWIMKIT(DDTTYLogger.o)
duplicate symbol _OBJC_METACLASS_$_DDTTYLoggerColorProfile in:
/Users/Arain/Library/Developer/Xcode/DerivedData/Taoji-aldpdybccvcoflbbrtplhgqzroqp/Build/Intermediates/Taoji.build/Debug-iphonesimulator/Taoji.build/Objects-normal/x86_64/DDTTYLogger.o
/Users/Arain/Desktop/ARAIN_PRO/develop/Taoji/LWIMKIT.framework/LWIMKIT(DDTTYLogger.o)
...
ld: 123 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I delete -ObjC in other linker flags, this can be solved, but when compiling, another problem shows which is unrecognized selector sent to class, I guess this framework define some variables or function whose name same as system.
Please help me!!!

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.

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.

iOS Linker Command Failed using Core Plot Xcode 4.3.2

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!