XCode 4, ParseKit and Archive Target - objective-c

I'm trying to archive an iPad application that used ParseKit. I'm able to run the app fine, utilizing ParseKit, for any build using the Debug Configuration (ie, Run on device / simulator ana analyze.) When I use the Release Configuration, however, I get the following linker error:
ld: library not found for -lparsekit
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

I had the same error. The fix for me was to select:
ParseKit.xcodeproj (subproject within my project)
-> Target: ParseKitMobile
-> Build Settings
-> Product Name
...and change the name from 'parsekit' to 'libparsekit'. Curious that this is necessary for XCode4, but it's now working for me at least.

Check your flags in your release target: your debug and release builds will probably have different compiler flags set. In XCode4, go into your target's build settings and look for the "Other Linker Flags" section. You will hopefully find your release linker flags don't have a '-lparsekit' flag.

Related

ld: framework not found GoogleMapsCore clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't know why I have this error("linker command failed with exit code 1 (use -v to see invocation)") on my IOS app.
This may happen because any of the following reasons.
if you do not import the framework properly.
if you are opening the .xcodeproj instead of .xcworkspace
Check the build settings -> Build Active Architectures only is set to No. (Then change it to YES)
Adding the other linker flags in Project and not in Targets. So, you move it to Targets, it shouldn't be in Project
I had a similar problem, and the problem was that mine Framework folder is not inside the project folder.
Build Settings > Framework Search Paths > enter these 2 lines in the window
$(PROJECT_DIR)/../<YOUR_FOLDER_WITH_FRAMEWORKS>
$(inherited)

Apple Mach-O Linker (ld) Error - Importing Frameworks

These frameworks work within another project but when creating a new project, it errors. The new project is blank and it fails because I import the frameworks. I am clicking and dragging the frameworks into Xcode.
Xcode 8.3.2 & Xcode 7.3.1
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These are my frameworks:
Screenshot 3
I have tried:
Recreating the project
Readding the frameworks
Set Build Settings -> Framework Search Paths -> $(PROJECT_DIR) to recursive
Checked frameworks added to Build Settings -> Link Binary With Libraries
Clean & Clean Build Folder

Why does xcodebuild fail when trying to link to test target?

I have an Objective-C Xcode project. Previously, there were no test targets in this project. We added a Swift-based test target and a few basic tests. The project continues to build from the Xcode GUI just fine. However, building from the command line fails when trying to link the test target.
% xcodebuild -project Foo.xcodeproj -scheme Foo -configuration AdHoc -sdk iphoneos build
...output...
The following build commands failed:
Ld /Users/mluton/Library/Developer/Xcode/DerivedData/Foo-hkljicipwnivteazylcxtobonsbc/Build/Intermediates/Foo.build/AdHoc-iphoneos/FooTests.build/Objects-normal/armv7/FooTests normal armv7
Ld /Users/mluton/Library/Developer/Xcode/DerivedData/Foo-hkljicipwnivteazylcxtobonsbc/Build/Intermediates/Foo.build/AdHoc-iphoneos/FooTests.build/Objects-normal/arm64/FooTests normal arm64
Running the Ld command manually results in this...
ld: file not found: /Users/mluton/Library/Developer/Xcode/DerivedData/Foo-hkljicipwnivteazylcxtobonsbc/Build/Intermediates/Foo.build/AdHoc-iphoneos/FooTests.build/Objects-normal/armv7/FooTests
If I navigate to that directory I see the file is indeed not there. I do see bunch of AFNetworking related files along with FooTest* files. Most have extensions like .d, .dia, and .o. But there's no FooTests which is what the linker is looking for.
If I edit the 'Foo' scheme I see there are two targets in the Build item. Foo and FooTests. If I uncheck everything associated with FooTests then the command line build will work fine.
Has anyone else tried this and run into the same problem? Am I missing a build setting somewhere? Am I asking for trouble by trying to do unit tests for an Objective-C project in Swift?

linker command failed error in case of Twitter+Oauth libraries

i am integrating twitter iOS app with my iOS app just for login purpose and for that i am using SCTwitter and Twitter+OAuth frameworks. but the problem is that when i build my project it gave me a compiler error like below:-
**ld: warning: directory not found for option '-L/Users/harvinder/Desktop/iphone_app 13/Twitter+OAuth/Libraries'
ld: warning: directory not found for option '-L&'
ld: warning: directory not found for option '-LHeaders'
ld: library not found for -lOAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)**
the above error clearly stated that the Twitter+OAuth library is not found but i have recheck my project and it is added and also i have tried many things like
1. library search paths($(PROJECT_DIR)/Twitter+OAuth/Libraries & Headers)
2.also check Link Binary And Libraries under build phases for libxml2.dylib and libOAuth.a
At last i delete the Twitter+OAuth folder and readded it and then everything works fine but the wired thing is that on the next day when i reopen my project in Xcode ,the same error encounter again and again i delete and readded the Twitter+OAuth folder and everything works fine again and same thing happens on the next day too. so i don't understand this weird behavior.
so please help me on this because everyday i have to delete and readd the folder to run my project.
Spaces are used to separate command line options and the directory with the library contains spaces, so you will need to ensure the command line interpreter doesn't see those spaces. That is generally done using quotes, so try this value in the Library Search Paths:
'$(PROJECT_DIR)/Twitter+OAuth/Libraries & Headers'
^ ^
Alternatively avoid using spaces in directory names.

card.io linker settings

On the GitHub instructions for Card.io it states "In your project's Build Settings (in the TARGETS section, not the PROJECTS section), add -lc++ to Other Linker Flags."
I can't find an entry of that name in Xcode 5. Either Im blind or its called something different now. Where should "-lc++" flag now go?
Its right there in Project > Target > Build Settings. Just type "Other Linker Flags" in the search:
I don't know why my Xcode 5.0.2 does not have an entry for "Other Linker Flags", but opening the "ScanExample" sample code from GitHub also does not have this entry in my setup. I found where the sample code has the -lc++ flag in its Linker settings but it is in the entry OTHER_LDFLAGS, so that must be where it goes if your Xcode does not label the Build setting as "Other Linker Flags"
Is this just a setting in my project to show the setting names in a literal style?
If so I'm surprised that using the search field wouldn't find it.