IOS6 build link error - objective-c

I build my app link with a static lib,found the errors follow
Undefined symbols for architecture armv7:
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
std::list<TSendBuf, std::allocator<TSendBuf> >::_M_insert(std::_List_iterator<TSendBuf>, TSendBuf const&) in libCardAnalyLib1.a(SendRecvThread.o)
"std::_List_node_base::unhook()", referenced from:
std::list<TSendBuf, std::allocator<TSendBuf> >::_M_erase(std::_List_iterator<TSendBuf>) in libCardAnalyLib1.a(SendRecvThread.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone tell me what is this error? thank you.
And there is C++ code in the app and the lib.
my demo app can not link the lib, shows this error, and the TSendBuf is
typedef struct {
unsigned char szBuf[1200];//1000 fah char
} TSendBuf;

You probably need to add libstdc++.dylib to the list of frameworks/binaries your application links to.
You can do that from target settings / "Build Phases" tab / "Link binary with Libraries" section

Library and app possibly do not match in link-settings.
Check specifically for the the C++ Standard Library setting, under Apple LLVM compiler within the Xcode Build Settings of both, your library and your app. Those need to match.
Supposed that the library in question is nothing you are building yourself, and if that library was built some time ago (pre Xcode 4.5/LLVM 4.1), then the "correct" setting for your app would be libstdc++ (GNU C++ standard library).

Related

Undefined symbols for architecture armv7s dealing with Appboy iOS integration

I am trying to integrate appboy into my Xcode 5.1.1 project. I have followed all the steps on their SDK integration page found here: http://documentation.appboy.com/SDK_Integration/iOS. I was able to successfully install the pods, but when I try to compile and run my project I get the following errors:
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_Appboy", referenced from:
objc-class-ref in CAppDelegate.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The code causing this issue it the code to upgrade the app delegate found in CAppDelegate.m under the method application:didFinishLaunchingWithOptions:
[Appboy startWithApiKey:#"(I PUT MY API KEY HERE)"
inApplication:application
withLaunchOptions:launchOptions];
Make sure that your app target includes "$(inherited)" if it is overriding any of the settings of Pods.xcconfig. You can check this under Build Settings >> Your App Target >> Other Linker Flags.
If you need any additional support on this issue, feel free to contact support#appboy.com.

ObjC Lbrary Usage: Undefined symbols for architecture armv7

I have XCode library I wrote which I use inside Unity3D application.
The library works and now I need to make a change in the implementation, not the interface.
The problem is that in the XCode project created from Unity3D, when I use my library .a file I get this error (I've remove the specific class names).
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ABNUnityativeController", referenced from:
_OBJC_CLASS_$_ABUnityNativeController in libABSDK_Unity_NativeController_iOS.a(ABUnityNativeController.o)
"_OBJC_METACLASS_$_ABNativeController", referenced from:
_OBJC_METACLASS_$_ABUnityNativeController in libABSDK_Unity_NativeController_iOS.a(ABUnityNativeController.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm pretty sure the problem is how I compile my library.
I find that my project settings were bad.
When I choose the main project (I also have sub XCode project in it) inside Build Phases -> Link Binary With Libraries I had to add my sub-project which was listed under Workspace directory.

Qt link library (C++ mix with objective C) error

I am using Qt to build UI Application,
The Qt application supposed to link to a static library (.a file)
The library is written by C++ and Objective C (*.mm) files.
I setup the Qt project file and linked the static library, but Qt Creator always gets linking error, and error is related with the function implement on *.mm which locates in the static library.
Question:
The Qt application how to link the library?
that's pure C++ application (Qt application) link to static library with C++ and ObjectiveC mixed (.a file).
update: link error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QTCaptureDevice", referenced from:
objc-class-ref in libmyapi.a(myTestFunction_mac.o)
"_QTMediaTypeVideo", referenced from:
myTestFunction() in myapi.a(myTestFunction_mac.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [myApp.app/Contents/MacOS/myApp] Error 1
14:38:06: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project myApp (kit: Desktop Qt 5.1.0 clang 64bit)
Qt5.1 with clang, support C++11
static library myapi.a, built by Xcode4.6 without error. Only one file is myTestFunction_mac, using QTKit framework.
myApp links myapi.a, but the myTestFunction_mac.mm implantation file has linking error.
You need to add QTKit framework to your app target.
Xcode 4
Click on the project in the browser pane to the left.
Click on the target under Targets.
Click on the Summary tab.
Expand Linked Frameworks and Libraries if not expanded.
Click on the + icon and type QTKit into the search box and add QTkit.
Xcode 3
Right click on the project.
Select Add-->Existing Frameworks.
Add QTkit.

Compiling libjpeg for iOS

I am trying to compile a project for iOS 6 in XCode, and I am using the following headers, which include the functionality I need:
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
#include "transupp.h" /* Support routines for jpegtran */
Those are straight out of jpegtran utility sources. I have installed the jpeg library before, and there is libjpeg.a in my /usr/local/lib/.
However when I try to compile, I am getting an error "Undefined symbols for architecture i386" or "Undefined symbols for architecture armv7", depending on whether target is an iPhone simulator or not.
Here are the keywords it can't find symbols for:
"_jpeg_stdio_src"
"_jpeg_finish_compress"
"_jcopy_markers_execute"
"_jpeg_copy_critical_parameters"
"_jtransform_adjust_parameters"
"_jpeg_destroy_compress"
"_jtransform_execute_transform"
"_jpeg_finish_decompress"
"_jpeg_read_header"
"_jtransform_request_workspace"
"_jpeg_write_coefficients"
"_jpeg_read_coefficients"
"_jpeg_destroy_decompress"
"_jpeg_stdio_dest"
"_jcopy_markers_setup"
I have encountered the missing symbol errors before, and always ended giving up on using 3rd party libraries, but in that particular case there's no way around.
What am I doing wrong here?
EDIT: I have added libjpeg.a to project settings and it did go further, but stopped now at:
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: i386-apple-darwin12.2.0
Thread model: posix
"lots-of-debug-paths"
ld: library not found for -ljpeg
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I recently needed libjpeg for iOS too (as a dependency of another third party library)
I ended up simply using the libjpeg-turbo, which comes with a precompiled fat binary
Architectures in the fat file: libjpeg.dylib are: i386 x86_64 armv6 armv7 armv7s arm64
I dunno how you compiled it. But you need to change the make install in order to compile it in i386 and armv7. I'm pretty sure you just run the make, so it compiled it for you mac, which is certainly a x84_64 arch, and this is certainly not what you want
You can check with
lipo -info /usr/local/lib/libjpeg.a // if libjpeg.a is at this path
or
file /usr/local/lib/libjpeg.a

Xcode 4 error SDK authorize.net

When trying to compile with Xcode, I am getting the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AuthNet", referenced from:
objc-class-ref in ConnectionManager.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using SDK authorize.net
please help!!
You haven't linked the library to your application. Select the project from the navigator sidebar, select your target, then go to the Build Phases section. Under Link Binary With Libraries, add the AuthNet library.
Sounds like you are not including the libraries correctly.
Make sure that you followed each of these instructions:
Set your Library Search Paths with the path that contains the "Authorize.Net SDK"
library. (ex. "$(SRCROOT)/ANMobilePaymentLib").
Set your Other Linker Flags with "-lxml2" to allow for xml parsing.
Set your Header Search Paths with the path that contains "libxml2" header
files. (ex. "/usr/include/libxml2" with recursive checked).