When i'm trying to use KIF, I get this linker error. Anybody know what is it?
ld: warning: directory not found for option '-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Framework'
ld: file not found: -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks for any idea.
I had this happen many times to me. Every time it was because I missed a step in the installation of KIF. Go back to the installation instructions and ensure you set all the configurations correctly. Pay special attention to the instructions for header paths. I am on my phone right now or else I would be able to give you the exact settings. Go double check the instructions. If your settings are correct reply here with that info and we can try to figure it out together. First though make sure these things are correct. Once you do, clean your project (Cmd-shift-K), close project, delete your derived data (preferably through Terminal) and then try to build again).
Related
My development environment with Xcode 7.2.1, CocoaPods 1.0.0 and GoogleMaps 1.13.2
I can build code successful to generate a XXX.ipa file and install in my iPhone 6 Plus to work correctly.
But when I run Xcode simulator by item "iPhone 6" or "iPhone 6 Plus" always get the information as below
"xxxx duplicate symbols for architecture x86_64" "linker command
failed with exit code 1 (use -v to see invocation)"
I use the following solutions still can't fix it
Build Options -> Enable Bitcode -> set "No"
Remove -ObjC from Other Linker Flags
project Targer -> Build phases -> compile sources, ckeck no duplicate files
Make sure I haven't #imported a .m file
I am wondering if there are any other method to solve this, help would be appreciated thanks.
This error generally occurs when you have linked any library or file twice.
In the error desciption, the name of the duplicated file will be listed, you can search and and make sure you don't have duplicates.
If you find duplicates, remove reference to one of them to play safe
I have faced similar kind of issue.
In my application I have run my code and created ipa before two day. And today when I am trying to run same code without any changes I am getting:
ld: 102 duplicate symbols for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
The solution for this duplication Linker error can be solved by Remove all of your classes from compile sources, then click the + button and search for the term '.m'. Highlight every class, then click add. Build and run again.
This problem can also be occurred in case you import ".m" file instead of ".h" by mistake. I know it may be seemed as a stupid advise but this is what I had done in my case.
I resolved this issue by removing the -all_load flag in the Build Settings-> Other Linker flags.
I'm trying to move an Xcode app from a MBP to an iMac. I've copied all the folders and files needed but keep getting to following error on build:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
After Googling around a bit the most common fix for this is to set Bitcode to no. I've done this but it doesn't make a difference. I've also tried quitting Xcode emptying the DerivedData folder and restarting.
Below is the error in Full:
Here is a list of my linked libraries:
It sounds a lot like the error is true - have you definitely got your libWikitude framework in a referenced path?
Go to XCode, Build Settings, find 'Framework Search Paths' under Search Paths, and make sure the folder of your libWikitude is correct.
Perhaps it's hardcoded and now the path has changed?
After a few headaches with this I decided to simply remove all references to the Wikitude lib as it was not being used by the app.
This immediately solved the issue. Thanks for those who answered.
I was having an issue with Google Maps and someone suggested changing -Objc in our build settings to -ObjC. When I do that I get a build error:
linker command failed with exit code 1 (use -v to see invocation)
I am coming into an existing app on this so there is no Test target, it was already removed. That seems to be a popular solution to this issue. If I revert it back to -Objc the app builds but I am getting #selector errors with the Google map instantiation.
And if someone could explain what (use -v to see invocation) means I'd really appreciate it.
It's saying that you're trying to link both a BugSense framework and a library from a Crittercism SDK and that they're colliding with each other because both contain a copy of the same .o file.
The reason you're seeing the problem is because -ObjC tells the linker to load all symbols (even if you have duplicates). To the best of my knowledge, -Objc has no meaning.
I'm having a issue compiling my app for Simulator. In the device runs perfectly but once I tried it to compile in simulator I get the following error:
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I checked before posting this question, but the answers I found in stackoverflow, like to run this,
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
or
The problem was that Xcode 5 replaces gcc with clang and adds in a "-triple" option that specifies OSX as the target. If you pass "-miphoneos-version-min=7.0" on both gcc command lines it works. You can see the clang command line if you pass "--verbose" to gcc. It's also necessary to add to the PATH for Xcode 5 so that cmake can find the necessary tools: export PATH=/Applications/Xcode5-DP6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode5-DP6.app/Contents/Developer/usr/bin:$PATH None of this is official.. but works for me so far.
I dont really understand how to to do this. Any help, please?
Check Build Settings for your test target. This values should look similar:
If you have any escaped symbol, consider to fix it. I had here : \". I just removed them
Also notice: order is important!
P.S. from GraehamF It's always a good thing to Build -> Clean and restart Xcode, so the changes to take affect
When I faced this error with an XCode project, I open the file ???.xcodeproj (in a SubLime Text editor) and removed the below lines. The warning will no longer be there!
LIBRARY_SEARCH_PATHS = (
"\"${PROJECT_DIR}/../../../../../usr/lib\"/**",
"\"${PROJECT_DIR}/../../../../../usr/lib\"/**",
);
My app was working fine until I started playing with archiving. Im not getting any compiler warnings or errors, but when I run the app, the build fails, saying
Apple Mach-o linker error: linker command failed with exit code 1 (use -v to see invocation)
I commented out all the archiving code I was playing with, but the build continues to fail, and I have no idea why. Again theres no warning/errors until I build, so I don't know what happened or where its coming from?
Can anyone tell me what this means and what I need to do to fix it?
EDIT:
Here is what the issue navigator says:
/Users/MikeGordon/Library/Developer/Xcode/DerivedData/HW1ARC-egqtecfuosawiadlwgfulhqjdhtr/Build/Intermediates/HW1ARC.build/Debug-iphonesimulator/HW1ARC.build/Objects-normal/i386/Assignment.o
ld: 18 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 18 duplicate symbols for architecture i386
EDIT: Here are some screen shots
http://imgur.com/3zd53ZP
http://imgur.com/tqhCa1g
http://imgur.com/Ena17FF
Check that there are no duplicates under Targets/Compiled sources. If there are duplicates, delete them.
I don't know how, but many of my .m/.h files were duplicated and under other folders. To remedy the problem, I deleted one copy of the file from one of the folders. The other duplicate file, then turned red. So, then I deleted the second copy of the file. At that point, I had no instances of either file in xCode. Then I went to my Trash, sorted by Date Added, highlighted the files that were just placed in Trash, right clicked and selected Put Back. The I went to File> Add Files to ("myProject") and selected the files I just restored. Everything was back to normal at that point. I ran the simulator and it all worked great!
Peculiarly, the Trash only had one instance of the file, even though it was referenced twice in the Project Navigator.