anyone got the error below when compiling the "iOS Client" from google "Mobile Backend Starter"?
Xcode 5.02, iPhone iOS 7.
duplicate symbol _kCloudBackendClientID in:
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/MessagesTableViewController.o
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/Constants.o
duplicate symbol _kCloudBackendClientSecret in:
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/MessagesTableViewController.o
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/Constants.o
duplicate symbol _kCloudBackendChainName in:
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/MessagesTableViewController.o
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/Constants.o
duplicate symbol _kCloudBackendServiceURL in:
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/MessagesTableViewController.o
/Users/paolo/Library/Developer/Xcode/DerivedData/CloudBackendIOSClient-gjhkqbarudkpudeeytxgowaihtym/Build/Intermediates/CloudBackendIOSClient.build/Debug-iphoneos/CloudBackendIOSClient.build/Objects-normal/armv7/Constants.o
ld: 7 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In file MessagesTableViewController.m
Change:
#import "Constants.m"
to:
#import "Constants.h"
Related
I've littered through Stackoverflow trying to get Unity unit test framework (https://www.throwtheswitch.org/unity) linked and built on CMAKE so that I can write unit tests but I keep hitting this same error:
Undefined symbols for architecture x86_64:
"_setUp", referenced from:
_UnityDefaultTestRun in libunity.a(unity.c.o)
"_tearDown", referenced from:
_UnityDefaultTestRun in libunity.a(unity.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/test_problem2_59.exe] Error 1
make[1]: *** [tests/CMakeFiles/test_problem2_59.exe.dir/al
I have documented my final attempt here https://github.com/aamarin/computer_systems/tree/dev with the latest commit being the unstable commit. I'm not sure what else I'm missing in computer_systems/tests/CMakeLists.txt to get this working. Just looking for some guidance and maybe an explanation I might be missing from here https://gitlab.com/CLIUtils/modern-cmake/-/blob/master/examples/extended-project/src/CMakeLists.txt. Guidance on better structuring my folder structure is helpful as well.
Just add empty functions named setUp and teadDown. UnityGettingStartedGuide.
I have tried to build my code dynamically and it worked as expected, however when I try to statically build with the option --ghc-options '-optl-static -fPIC' I got the follow error
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
any idea?
edit : I added the c tag since I though the gcc is somehow related to c and I guess the error related to c library
I am trying to build and run a basic C program in Xcode, but keep getting a "build failed" message. The script is nothing too crazy, just a natural number calculator, there's nothing wrong with the script as I've tested it on an online compiler and it works fine.
This is the full error message:
Ld /Users/Matt/Library/Developer/Xcode/DerivedData/testing.c-ckojksceiqxrcdcfavsxvsgvapin
/Build/Products/Debug/testing.c normal x86_64
cd /Users/Matt/Code/testing.c
export MACOSX_DEPLOYMENT_TARGET=10.9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
/Developer/SDKs/MacOSX10.9.sdk -L/Users/Matt/Library/Developer/Xcode/DerivedData/testing.c-
ckojksceiqxrcdcfavsxvsgvapin/Build/Products/Debug -F/Users/Matt/Library/Developer/Xcode/DerivedData
/testing.c-ckojksceiqxrcdcfavsxvsgvapin/Build/Products/Debug -filelist /Users/Matt/Library/Developer
/Xcode/DerivedData/testing.c-ckojksceiqxrcdcfavsxvsgvapin/Build/Intermediates/testing.c.build/Debug
/testing.c.build/Objects-normal/x86_64/testing.c.LinkFileList -mmacosx-version-min=10.9 -Xlinker
-dependency_info -Xlinker /Users/Matt/Library/Developer/Xcode/DerivedData/testing.c-
ckojksceiqxrcdcfavsxvsgvapin/Build/Intermediates/testing.c.build/Debug/testing.c.build/Objects-
normal/x86_64/testing.c_dependency_info.dat -o /Users/Matt/Library/Developer/Xcode/DerivedData
/testing.c-ckojksceiqxrcdcfavsxvsgvapin/Build/Products/Debug/testing.c
duplicate symbol _main in:
/Users/Matt/Library/Developer/Xcode/DerivedData/testing.c-ckojksceiqxrcdcfavsxvsgvapin/Build
/Intermediates/testing.c.build/Debug/testing.c.build/Objects-normal/x86_64/tests.o
/Users/Matt/Library/Developer/Xcode/DerivedData/testing.c-ckojksceiqxrcdcfavsxvsgvapin/Build
/Intermediates/testing.c.build/Debug/testing.c.build/Objects-normal/x86_64/main.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anybody know how to solve this? I've been searching for an answer for ages with no luck.
You have two "main" functions defined.
One in a file named "main.c" and the other in a "tests.c" file. Remove one of them and you should be okay!
Or, if you only have a "testing.c" file, do a Clean on your xcode project and try building again.
i want to use libTestFlight.a library in my project, i already import it in "Link Binaries With Libraries", also in build phases, i tried to add "Search Path" and "Header Path", i also tried to change the ARCH to Standard architectures (armv7, armv7s), but still no luck, it always give this error:
Undefined symbols for architecture armv7:
"_deflate", referenced from:
__tf_remote_log_compress_data in libTestFlight.a(tf_remote_log_io.o)
"_deflateInit_", referenced from:
__tf_remote_log_compress_data in libTestFlight.a(tf_remote_log_io.o)
"_deflateEnd", referenced from:
__tf_remote_log_compress_data in libTestFlight.a(tf_remote_log_io.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Add the libz.dylib as the Link Binary With Libraries.
Build Phases > Link Binary With Libraries > push the + button > search the libz.dylib and select it > push the Add button.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in FirstViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've looked over FirstViewController, reachability.h and reachability.m - It's clearly defined! And I've even added SystemConfiguration.Framework, as well as Reachability.m is in the compile list.
Any ideas? I'm losing my mind!
Pic attached.
http://i.imgur.com/uw4Zb.png
Try to remove references to Reachability.h and Reachability.m files from your xCode project. - Make sure it disappears from Compile Sources.
Search you project's folder to make sure you don't have duplicates for Reachability.h and Reachability.m files in it
Command+Shift+K to clean the project;
Add Reachability.h and Reachability.m back to the xCode project;
Hope this will help.