I opened my old project in Xcode 7.1 and I encountered an error.
ld: framework not found LibXL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had the framework LibXL in the project folder.
Always search user path is set to YES. //Tried with NO
Framework Search Path is set to the framework path $(PROJECT_DIR) which is /Users/Mr.T/Desktop/Project. //Tried with recursive and non-recursive
More information:
I am not sure about the run path search path, and what value it should contain!!!
Go to Build Settings and add $(PROJECT_DIR) non-recursive to Framework Search Paths
There is no need to change Runpath Search Paths
The framework got updated by LibXL and somehow the old framework is not recognised by the Xcode. I downloaded the framework again, and add it to the project!!! It worked now!!!
Related
I have an issue that is going on for over a month and I can't find any solution for it.
I created an Appcelerator Titanium Module, which uses the OpenCV framework.
I tried literally everything I found on the internet to make it work, but no sucess.
The module compiles, but it crashes when building the App that uses it.
To dig deep in the problem, I compile the App via CLI using appc run -p ios -l trace to see the whole thing. This is what I get:
[TRACE] ld: framework not found opencv2 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
This happens if I declare the framework in the module.xconfig file, like this:
OTHER_LDFLAGS=$(inherited) -framework opencv2
If I don't declare it in the file, I get:
[TRACE] symbols not found for architecture x86_64 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
Well, the opencv2.framework file is inside the /ios folder in the module.
This is what I tried so far, to put the OpenCV Framework in the project:
OpenCV Official Example for XCode
Compiling it from scratch and then adding to the Project
brew install opencv and then adding it to the project
I configured Framework Search Paths like this:
$(inherited) $(PROJECT_DIR) $(SRCROOT)
Header Search Paths like this:
$(inherited) "$(TITANIUM_SDK)/iphone/include" /usr/local/Cellar/opencv/4.4.0/include (this last one, when installed by brew CLI command.
The Other Linker Flags, is configured like this:
This configuration I got from this tutorial: OpenCV on XCode
And finally, I tried adding the .dylib files from the source of the OpenCV Framework in the project by right-clicking the project's name and Add Files.
So, I tried everything I could find to solve it, but I can't get it to work.
Sorry for the long question, but I am completly out of ideas on how to make this work.
Please, help me!
First of all, the opencv2.framework is copied automatically to the XCode /ios folder (if you selected Copy Files if Needed). BUT, Appcelerator needs 3rd party frameworks to be put on /ios/platform folder. So, I moved it there.
Secondly I added -lz to the Other Linker Flags in Build Settings.
This solved the problem. I must thank the team and developers from TiSlack (An Appcelerator platform community), which helped me through this. Michael and Hans, Thanks!
Here is a video that helped me install OpenCV4 on my Macbook Pro Mojave 10.14.6. I tried installing OpenCV using another video and it led me to getting a linker error that was similar to yours.
Basically, the problem was the path I specified as for my /lib and /include folders.
https://www.youtube.com/watch?edufilter=NULL&v=HxNZEa7Slyk
I have been trying to deal with a lot of problems since I upgraded the react-native version of my app.
One of those was this that came out of nowhere!
ld: warning: directory not found for option '-F~/Documents/FacebookSDK'
Followed by these (which caused extra confusion)
ld: library not found for -lRCTWebSocket clang: error: linker command
failed with exit code 1 (use -v to see invocation)
How can I solve this?
I did some googling and used some tips trying to solve it. Most of them did not work. So I decided I should share the solution that worked for me.
Quote from another SO discussion:
if your error includes the -L flag, then delete the values in Library
Search Paths if your error includes the -F flag, then delete the
values in Framework Search Paths
I checked the framework search path values under Build Settings
It was like this:
For both Release and Debug configurations.
I deleted the line for FacebookSDK (line 3) from both release and debug configurations, and did another react-native run-ios.
And it worked!
I hope this helps...
I'm not able to build my app with the Facebook SDK in iOS 10. I've included both the "Bolts.framework" and "FBSDKCoreKit.framework" frameworks to my projects. I've also added my Facebook SDK folder to the "Framework Search Paths" in "Build Settings". This is the folder that contains these frameworks.
I'm getting this error and I'm not sure how to resolve it. My project compiled fine in Xcode 9 but won't compile in Xcode 10. Is there another step I'm missing in Xcode 10?
'FBSDKCoreKit/FBSDKCoreKit.h' file not found
UPDATE: Xcode seems to not be able to find the frameworks. This is the error I'm getting. I dragged the frameworks into Xcode from that folder. If I right-click on the framework and click "Show in Finder" it goes right to the frameworks so I don't understand my Xcode can't locate them.
ld: warning: directory not found for option '-F~/MY_FOLDER/FacebookSDK'
ld: framework not found FBSDKCoreKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)
UPDATE 2: Even if I remove that folder from my build options Xcode still complains it can't find the frameworks. I have to completely delete them from my project in order to build successfully.
I tried to install the Charts framework for my application but for some reasons things wouldn't work. Therefore, I decided to remove it from the application in order to reinstall a different version, but now I get an error when building:
ld: warning: directory not found for option '-F/Users/antonkallbom/Library/Developer/Xcode/DerivedData/Aiida-dwnonkyfsunbssdfeglitwzmrecb/Build/Products/Debug-iphonesimulator/Charts'
ld: framework not found Charts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So I guess I need to remove the path somehow in order to be able to build the project? I tried deleting all the filed in DerivedData, but without success.
I saw some similar problems where you were supposed to remove the paths from "Framework Search Paths", but I don't seem to have it in Xcode?
The setting is within Build Settings:
Search for "Search Paths" and you should see Framework Search Paths...
Okay, I finally got it working! :)
There were flags included in .debug.xcconfig and .release.xcconfig, as well as some additional paths in -frameworks.sh. After removing them, it works!
Should have thought about searching the whole project earlier... Thanks for the help!
I'm getting these errors:
ld: warning: directory not found for option '-L"/pathToMyApp/MyApp/Shared/Libraries/ADMS_AppLibrary"'
ld: warning: directory not found for option '-L"/pathToMyApp/MyApp/Shared/Libraries/TestFlightSDK1.1"'
ld: warning: directory not found for option '-L"/pathToMyApp/MyApp/Shared/Libraries/Medialets"'
ld: library not found for -lTestFlight
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These directories do in fact exist at the paths above.
The thing is, the app used to compile fine. All I did was add a new version of the Medialets library to the project, and now I get these erros.
There are two errors that people seem to be confused about:
If it is a "directory not found for option '-L/..." error That means it's a Library Error, and you should try to:
Click on your project (targets)
Click on Build Settings
Under Library Search Paths, delete the paths
If it is a "directory not found for option '-F/..." That means it's a Framework Error, and you should try to:
Click on your project (targets)
Click on Build Settings
Under Frameworks Search Paths, delete the paths
I had the same problem when I added a new library to the project.
It seems that the linker error occurs when the Xcode 5 adds a path to "Library Search Paths" automatically when adding a new library directory to the project.
The linker error disappeared once I manually edited the paths. (I didn't essentially change the path, just tried some different formats such as $(PROJECT_DIR)/path/to/library or "$(SRCROOT)/path/to/library". It worked even after changed back to the original format.)
I think it's a bug of Xcode. I'm using Xcode 5.1 (5B130a).
For the "-L" issue,
If you are using cmake (in my case 3.3.2) and use the xcode generator, it will generate multiple entries for each link-directory you specify,
link_directories ("${PROJECT_SOURCE_DIR}/SDKs/thelib/lib")
see the cmake sourcecode, cmGlobalXCodeGenerator::AddDependAndLinkInformation(...) where it does this:
{ ...
if(this->XcodeVersion > 15)
{
// Now add the same one but append
// $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to it:
linkDirs += " ";
linkDirs += this->XCodeEscapePath((*libDir + "/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)").c_str());
}
linkDirs += " ";
linkDirs += this->XCodeEscapePath(libDir->c_str());
}
which will result in XCode having these entries in the Lib Search Path
/Users/myuser/thelib/lib/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
/Users/myuser/thelib/lib
So that makes it a bit more difficult to get rid of this warning; Depending on your file-structure, one of those is likely going to be wrong - and even if you manually remove it they will be back next time your project is regenerated.
One work-around is to just create empty directories for the ones it complains about...
It's also possible to "pass some arguments" to the linker using "-Wl", but so far I didn't find out what to pass to silence that specific warning.
ld: warning: directory not found for option '-L"----it's a Library Error
Select your project go to the Build Settings tab,Under Library Search Paths, Replace the path with this string $(SRCROOT)
Just removing the lib from "Link With Binary With Libraries" section of "Build Phases" doesn't seem to resolve the issue in Xcode 6 at least.
1) Go to your project navigator and find the "Frameworks" folder
2) your lib is probably there already, so just right click and "Delete"
3) Select "Remove References"
4) go to your repo or project folder where all your files are and drag
it into the "Frameworks" folder
5) clean, and rebuild and the errors should go away
I did not have any added library paths under Library Search Paths, but instead I could solve this issue by deleting the Derived data, by going to Preferences -> Locations
I started seeing both -L and -F errors in the build for a react native app and none of the existing answers solved the problem.
For me the problem was I had updated the ios version in my Podfile:
platform :ios, '11.0'
but not in the xcode project.pbxproj file:
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
(The setting appears multiple times in the .pbxproj file)
Making the versions match solved the problem.