ShareKit PKMultipartInputStream linker error - objective-c

Recently I've updated ShareKit in my app via the git submodule method.
However, now it won't build anymore. I've gone through the installation Wiki again, seeing if I've missed any frameworks to include or something, but I can't find any I've missed.
Besides this, I've also changed the setting "Build active architecture only" to no, so it will always build all architectures. But to no avai.l
The error I'm getting is the following:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_PKMultipartInputStream", referenced from:
objc-class-ref in libOAuth.a(NSMutableURLRequest+Parameters.o)
ld: symbol(s) not found for architecture armv7
Strange thing is, I also included ShareKit in another project and there it didn't give any errors. So I know I must be doing something wrong, but I can't figure out what. Do you guys have any hints of where to look? Or has one of you encountered the same error?

This can be solved by adding PKMultipartInputStream.m to the Compiled Sources in OAuth build settings inside ShareKit subproject

You probably have to add PKMultipartInputStream target to Target Dependencies and libPKMultipartInputStream to Link Binary With Libraries in your project.
It is better than making changes to external project.

Related

iOS manually exporting library causes issues

I made a library and I want to test it in a dummy project I made. Both projects are made in Objective-C. When I build my library I get a Successful Build message and three files under the Product directory:
FooIOS.bundle
libFooIOS.a
include
I place these three files at the root level of my dummy project and when I open my myDummyProject.xcworkspace file I see them in my project hierarchy. However, when I build my project I get the following error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_FooSelectedPageViewController", referenced from:
objc-class-ref in libFooIOS.a(FooViewController.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I did away with some of the obvious checks:
Made sure to reference my external library
I also made sure that both my library and project architectures are set as armv7 arm64
I don't know what else to do. I may be missing another configuration step or it may even be the way I declared something in my library that doesn't conform with my dummy project. Or a discrepancy between projects, perhaps? Any hints or leads would be a great help. Thanks.

_OBJC_CLASS_$_KeyboardViewController", referenced from:objc-class-ref in KeyboardPreferencesController.o

I am totally stuck with an error I am getting when trying to test project on the simulator.
Error looks like:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_KeyboardViewController", referenced from:
objc-class-ref in KeyboardPreferencesController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am building custom keyboard using keyboard extension and what I am trying to do is that in main application I am implementing settings view to modify keyboard like font change... so of course, it needs to be linked to extension header file KeyboardViewController.h
I have tried to add Other Linker Flags -> $(inherited) in both debug and release, also tried to switch Build Active Architecture Only -> YES but it also does not worked for me.
So is there any other solution for this because I can not find anything what will work for me.
Thanks in advance!
You need to compile and link the implementation file (KeyboardViewController.m?) into your target.
Use Xcode's File Inspector to make sure target membership is turned on. Look at the build phases to make sure the implementation file is included.
If those things are correct, look at the KeyboardViewController.m to make sure it actually has a #implementation section.

Removed/Re-Added file, now I get Undefined symbols for architecture arm64:

In my app, I removed then re-added a class. The target membership for the .m file is checked and it appears under Build Phases->Compile Sources. "Build Active Architecture Only" is set to "No", and the "Valid Architectures" are "arm64 armv7 armv7s". I also tried clearing out the DerivedData folder. What other ways are there to fix this issue?
This worked for me:
ios sdk 9.3
into your build setting of app.xcodeproj valid architecture: armv7 armv7s Build Active architecture : No
Clean and build.
Pretty crazy stuff. Figured it out. Turns out the specific class I added calls some C++ functions, so I needed to change its file type to Objective-C++ in the Identity Inspector.

Do not use -ObjC flag for linked library in XCode

I need to link two libraries in a project, Cordova and a library from a hardware manufacturer. The hardware manufacturer's library gives an error if you compile with -ObjC but Cordova requires -ObjC flag.
Is there a way to force the -ObjC flag for a library and not for the other (or vice-versa)?
Thanks!
Specific error: Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MPMusicPlayerController", referenced from:
objc-class-ref in libdtdev.a(AudioStream.o)
It looks like a posted the question just before I figured it out (like always). Instead of deleting the post, someone might want to know what the solution was...
If I keep the -ObjC flag in place and add the frameworks it's complaining about to the "Link Binary With Libraries" section (in my case "MediaPlayer.framework").

TouchJSON Fails on Compile (link error)

Undefined symbols for architecture x86_64:
"_objc_unretainedPointer", referenced from:
-[CJSONScanner scanJSONStringConstant:error:] in CJSONScanner.o
-[CJSONSerializer serializeNumber:error:] in CJSONSerializer.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hey all. Trying to use TouchJSON to do some JSON-y stuff. I followed the read me for the library to the meter I think, but every time I try to compile I get this error. I don't know much about Xcode (I've only been learning Obj-C recently) so I'm clueless about this. Any ideas?
Try to remove "Experimental" folder (and files inside, of course).
README
Be aware that the code in the Experimental subdirectory of Source is
just that and may not have been extensively tested and/or have extra
dependencies
So it could be a problem about extra dependencies (but always make sure if your project already have linked all dependency libraries/framework)