CocoaFob - linker command failed with exit code 1 - objective-c

This is a weird error! I'm getting:
ld: framework not found CocoaFob
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've checked all my build settings - and they appear correct. CocoaFob.framework is in my Linked Frameworks and Libraries - showing healthy and black. For some reason though, the damned framework isn't found when I try to link. Does anyone have any ideas?
Once possible clue is that when I try to the cocoafob application ( from here: https://github.com/glebd/cocoafob ) I get exactly the same error. I'm using Xcode 8.2.1

Okay. So the solution for me (and hopefully this will help anyone else who's experiencing a similar problem) was to:
build CocoaFob as release (I'd already done this, but in the interests of completeness) copy the resultant built framework to /Library/Frameworks and use it from there.
Do not attempt to use it in the location where it was built! Neither should you create a symlink in /Library/Frameworks to the location where it was built.
This done, all works well. Phew!

Related

library not found for -lReact

I'm getting this error in all my app builds now and I can't seem to figure it out.
I am using the .xcworkspace file
I had to rename the app. Used: react-native-app-id ...
This morning I was able to build/run on emulator. I tried to setup xcode to run on an actual device and now the universe hates me.
I can't even react-native start and react-native run-ios without getting these errors:
ld: warning: directory not found for option '-L/Users/gmike/Projects/promiscue/tribeoffive/TribeOfFive/ios/build/Build/Products/Debug-iphonesimulator/React'
ld: library not found for -lReact
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/tribe-of-five normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/tribe-of-five.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/tribe-of-five.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I've checked out a bunch of other stackoverflow articles.
I think this is telling:
Thoughts on how to un-mess up my env?
The error goes away when you remove libReact.a from the Xcode file tree (for me, it was under the Frameworks folder).
I also removed other files (they all had a transparent/white overlay on them which probably mean they were missing, actually couldn't open them in the finder neither)
Ok let's resolve this:
What to look for:
Here's a list of all the sub projects (or their products) that will cause XCode to throw that error when building a react-native project w/ cocoapods:
[
RCTActionSheet,
ART,
RCTBlob,
RCTCameraRoll,
RCTGeolocation,
RCTImage,
RCTLinking,
RCTAnimation,
RCTNetwork,
RCTPushNotification,
RCTTest,
RCTSettings,
RCTText,
RCTVibration,
RCTWebSocket,
]
Where to look for those weird project names:
First of all you'll look in the actual error message.
Here's a typical library not found error
Notice the ... /libART.a part?
That fellow is causing that error on my end.
In your case it can be any of the strings in the array above.
Found the troublemaker, what to do now?
Step 1: Remove the troublemaker project.
Let's try the lucky shot first:
Open the Project Navigator, and check if you can see the linked project that corresponds to the troublemaker string. In my case it was an XCode project called ART.
If you find it there, just remove it's reference, and you should be fine.
If that didn't work:
Open {Project Target} > Build Phases > Link binary with libraries and check wether you can see the troublemaker string in there. (It could be something like libArt.a depending on what's causing the issue on your end)
If that worked, forget the next step, otherwise move on:
Step 2: Delete the derived data directory, clean and rebuild
In my case (as seen in the raw error above) the derived data directory was /Users/sudoplz/Library/Developer/Xcode/DerivedData/MySuperApp-haxjchilyksewvdfcnnxwrulvyvy/Build/Products/Debug-iphonesimulator/
find yours in the error log, and delete it.
You can then clean XCode, shut it down, launch it again, and re-build.
Hopefully that should either fix the issue, or help you move on with fixing other stuff that may have gone wrong.
That's all folks.
Try to add that file to the libraries by finding libReact.a from the project, then clean and run Xcode.
or
Try to add libReact.a to your project "Build Phases" > Link binary with libraries, then clean and run Xcode.

Apple Match-O linker error (library not found for -lGoogleToolboxForMac)

library not found for -lGoogleToolboxForMac
error: linker command failed with exit code 1 (use -v to see invocation)
i get this error when i run Xcode project.
I used xcode 8. Upgrade it to xcode 9, lGoogleToolboxForMac is included in it.
The answer to this Stack Overflow question (Framework not found GoogleToolboxForMac) that describes how to change your Build Active Architecture Only from "Yes" to "No", fixed this issue for me. But other answers worked for others.

App not running: Compile error : linker command failed with exit code 1 (use -v to see invocation)

I've seen people ask this question before, but I have tried some of the answers and can't seem to fix the problem.
I changed the name of my app and it was working fine until I restarted Xcode now I am getting the error:
Its coming from the tests target...
If anyone can add any input would be much appreciated.
Thanks.

Connecting HTTPKit to a Theos application project. Undefined symbols error

Aim
I am trying to build the simplest Theos application that is acting like HTTP server.
I have no specific preferences on what libraries to use, but I tried by best using HTTPKit this time. I will appreciate any comments and/or links on how to build such applications.
Question in a couple of words
Failed to use HTTPKit in Theos application project. Getting "Undefined symbols" when using any of the HTTPKit classes.
Personal thoughts
I am sure the "Undefined symbols" error is caused by wrong linking. And I am almost sure that it has to do something with the dependencies folder since I have no idea where to put it and how to link it.
It's not completely neccessary to use HTTPKit, but I am having quite the same troubles trying to implement CocoaHTTPServer in Theos application.
I will also appreciate any comments on what I am doing wrong while installing Theos and making applications.
How I installed and configured Theos
Installed Theos using the following guide
Downloaded everything from one of the headers repository into
$(THEOS)/include
Downloaded (additionally) IOSurfaceAPI.h from here into
$(THEOS)/include/IOSurface
Making a simple project
1.Created a Theos application using NIC
cd ~
$THEOS/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/application
[2.] iphone/library
[3.] iphone/preference_bundle
[4.] iphone/tool
[5.] iphone/tweak
Choose a Template (required): 1
Project Name (required): name
Package Name [com.yourcompany.name]:
Author/Maintainer Name [***]:
Instantiating iphone/application in name/...
Done.
2.Put the whole repository HTTPKit into newly created folder
~/name/HTTPSources
3.Added the following line
name_FILES += $(foreach ext, c cpp m mm x xm xi xmi, $(wildcard
HTTPSources/*.$(ext)))
into the Makefile, so it looks like this
4.Put all files from here into newly created
$THEOS/include/HTTPKit
5.Now the $(THEOS) folder looks like this
6.Calling make now doesnot cause fatal errors (except ldid command, which I guess is not vital) resulting in
~/name/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for application name...
Copying resource directories into the application wrapper...
Compiling main.m...
Compiling nameApplication.mm...
Compiling RootViewController.mm...
Linking application name...
Stripping name...
Signing name...
/bin/sh: ldid: command not found
Trying to use HTTPKit, getting errors
1.Added HTTPKit import and a few simple lines from the example
HTTPServer * serv = [[HTTPServer alloc] init];
[serv handleGET:#"/hello/*"
with:^(HTTPConnection *connection, NSString *name) {
return [NSString stringWithFormat:#"Hello %#!", name];
}];
into ~/name/main.m so it looks like this
2.Now calling make causes "Undefined symbols for architecture armv7" error
~/name/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for application name...
Copying resource directories into the application wrapper...
Compiling main.m...
Linking application name...
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_HTTPServer", referenced from:
objc-class-ref in main.m.f3071598.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [obj/name.app/name.ba964c90.unsigned] Error 1
make[1]: *** [internal-application-all_] Error 2
make: *** [name.all.application.variables] Error 2
Additional info
find ~/name
make clean all messages=yes
Try adding
export ARCHS = armv7 arm64
export TARGET = iphone:clang:7.0:7.0
to your makefile.
That fixed a similar error for me. If the error is different would you be so kind as to post the output?
I think you missing library. You only have HTTPServer header but lack of implement. Compile HTTPKit and put it on $THEOS/lib. Then add name_LIBRARIES = nameoflibHTTKit in Makefile

How to handle "linker command failed with exit code 1 (use -v to see invocation)"

I had an error like
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have searched, did all provided solution. but still same error. I have attached the screen shot of error page. Can anybody help me how to resolve this issue.
Thanks in Advance.
Does this link help?
http://discuss.cocos2d-x.org/t/library-not-found-for-lcurl/12035
In summary:
Caused by adding AdMob or Flurry to the project.
Check Build Settings > Library Search Paths and ensure that they are correctly rooted so they point to the correct libraries. Others had some success in removing the $(SRCROOT) bit and turning them into absolute paths.