I've been trying to include libilbc.a library from the webRTC project into my iOS app. I'm linking it to static library (c++, Xcode project) and then linking this library to my iOS app. It's all in one workspace.
I'm stuck on the next linking error:
Undefined symbols for architecture arm64:
"_WebRtcIlbcfix_EncoderInit", referenced from:
If I check the library architecture I get the right info:
$ lipo -info libilc.a
$ Non-fat file: libilbc.a is architecture: arm64
Also if I check the content of the library, it includes the object:
$ nm libilbc.a | grep "_WebRtcIlbcfix_EncoderInit"
$ U _WebRtcIlbcfix_EncoderInit
I have included header files into the Xcode project and linked with -lilbc flag.
Remark:
I have successfully build the same project for simulator with different library that I got on Github and it worked (meaning, there is nothing wrong with the linking or including header files). The problem is that mentioned library isn't compiled for arm64 architecture.
I would really appreciate if someone knows where could I get compiled ilbc library (for ios arm64) or how to integrate the library from the webRTC project.
Related
i am looking for solution of merging my own library with third party library on ios platform.
i have my desktop project with some C++ functions, which i want to use in ios app. In original this project use fftw3 lib, which i built from sources on windows. fftw3 is included as static lib(.lib file) with suitable header:
#include <fftw3.h>
I made ios static c++ lib from VS template and transfered my code to there. But there is no library depencies option in the project settings, so i can't add fftw3 lib to this project. The project is sucsefully building(with adding fftw3 header inside project) on ARM64 platform in ".a" file on remoted Mac, but of course it failed, when it used by client code. I have a lot of errors like this:
Undefined symbols for architecture arm64:
"_fftwf_alloc_complex", referenced from:
Also i built fftw3 lib on Mac with arm64 platform and got libfftw3.a file. After that i tried to merge these libs toghether with libtool:
libtool -static -o new.a mylib.a libfftw3.a
But i have got the same errors. What am I doing wrong?
I have c++ project where I have 3 libraries. Two static and one dynamic which is dependent from first two. Those two are building successfully and third is crashing while building because lack of symbols from static libs. There is also warning which I think is crucial here:
ld: warning: ignoring file /Users/pwpw/Desktop/plid/Core/../Common/libcommon64.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
I am using QT to build the project. The problem occurs only on MacOS and my version is now 10.15.2
Recently I started working with Boost on Windows for a project. It needs to be cross-platform so I also installed it on Mac. Unfortunately; whenever I add it to the Xcode project it gives me a big slew of linker-errors and conversion-warnings.
Example of one of the linker-errors:
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in main.o
boost::asio::error::get_system_category() in main.o
boost::system::error_code::error_code() in main.o "boost::system::generic_category()", referenced from:
___cxx_global_var_init in main.o
___cxx_global_var_init1 in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
Example of one of the conversion-warnings:
In file included from
/usr/local/Cellar/boost/1.57.0/include/boost/date_time/posix_time/posix_time_types.hpp:16:
/usr/local/Cellar/boost/1.57.0/include/boost/date_time/posix_time/posix_time_duration.hpp:24:21: warning: implicit conversion loses integer precision: 'long' to
'hour_type' (aka 'int') [-Wshorten-64-to-32]
time_duration(h,0,0)
I tried several installation methods and configuration methods but it still won't work.
These are my steps:
Compile Boost or get a compiled version of Boost.
Create an XCode project.
Enter this sample code in the main class.
Add the header and library paths to the Xcode project file.
Build.
Compile options I have tried:
Compiling from source using the official guide.
Compiling from source using a few scripts I found here on Stackoverflow.
Installing the brew package manager and downloading a package with binaries.
Configuration options I have tried:
Setting the header search path to /usr/local/Cellar/boost/1.57.0/include or equivalents and
setting the library search path to /usr/local/Cellar/boost/1.57.0/lib or the equivalents.
Setting just the header search path but not the library path.
Option 1 but recursive (causes more errors).
I would appreciate it a lot if someone could point me in the right direction. I think it's something Xcode related since all of the compiled versions give me the same errors.
I found the answer. After the header- and library paths are added to the projects search paths you need to go to "Build Phases". There you need to add the individual libraries you need to the "link libraries to binary" subsection. You can find the necessary files in the lib folder (in the boost folder).
You can choose for either the library files with .a extension or with the .mt.dylib extension. If you choose the .a extension files the library will be added to the compiled version of your program. If you choose the .mt.dylib files then the libraries will not be added to your compiled program. In this case you are assuming the dynamic library files are already present on the computer running the program.
I've built a 32 bit library that is a requirement to my project. Here's its lipo info:
LP:lib hcabral$ lipo -info Release-iphoneos/librmservices_iphone.a
input file Release-iphoneos/librmservices_iphone.a is not a fat file
Non-fat file: Release-iphoneos/librmservices_iphone.a is architecture: armv7
I link the library in my project, it shows up in "Link Binary with binaries", etc., and yet I get this error:
Undefined symbols for architecture armv7:
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
xpath::YaccParser::getObjectPointer(uft::Value*&, bool) in librmservices_iphone.a(xpath_yacc.o)
xpath::YaccParser::performLexicalAnalysis(uft::Value*&) in librmservices_iphone.a(xpath_yacc.o)
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
xpath::Context::removeDynamicContext(uft::Value const&) in librmservices_iphone.a(xpath_context.o)
"_kCFProxyPasswordKey", referenced from:
DLProxySettingsController::getSystemProxySettings() in librmservices_iphone.a(DLProxySettingsController.o)
"_kCFNetworkProxiesHTTPProxy", referenced from:
(...)
All the projects I limited to armv7 and no solution. Any ideas?
So, I have a project A that is pure Objective-C, but it depends on a Project B that is C/C++ and Objective-C, and happens to be 32-bit code only.
Up until Mavericks and Xcode 5.1.1, I built Project B for all platforms (Release and Debug for iOS and i386) in order to debug, run tests and eventually deploy. Project B has its own set of linker flags and options that make it very special.
In project A, I would link the binaries of Project B (libProjectB.a) and it has always worked.
However, during this last iteration, Project A build process complained about missing symbols for armv7, which confused me, because project B is compiled ONLY in armv7 and i386.
The only way I manage to remove 30+ linking errors, was by linking the following frameworks:
libstdc++.6.0.9.dylib
CoreText.framework
CFNetwork.framework
Foundation.framework
I hope these don't look like random frameworks to you, but I found out by adding one by one, based on the type of linking error. For example, I added the CFNetwork only after opening the C++ code and noticing that the symbols would be part of it.
Anyway, again, I don't know why it happened yet, but it happened by using Yosemite and Xcode 6.1. Hope this can shed a light on someone.
I wish to use Tesseract with OpenCV on a C++ project (not iOS) I'm working, but I'm unable to get Tesseract to work with XCode. I've added the .dylib files for Leptonica and Tesseract and it works fine, but then I get the following error when I run the APIExample program
read_params_file: parameter not found: save_raw_choices
If I do not add the .dylib files and try adding the header files obtained through Homebrew, I get the following error
Undefined symbols for architecture x86_64:
"tesseract::TessBaseAPI::GetUTF8Text()", referenced from:
tesseractTest() in main.o
"tesseract::TessBaseAPI::End()", referenced from:
tesseractTest() in main.o
I'm a little inexperienced with development in Mac OS X.
I encountered same problem and found only this remark on google groups:
http://code.google.com/p/tesseract-ocr/issues/detail?id=990
Basically, just use different tessdata - e.g. download spanish and set it as language. It would pass that step and show some results. Though they were not splendid in my case but at least you will see it working:).
Then I would recommend asking at the project google group for help...
I had the same problem when I didn't include the tesseract c flags and libraries when compiling.
if you add this to your cflags: pkg-config --cflags tesseract
and this to your libs: pkg-config --libs tesseract
then it should compile.
I know it is an old question but I didn't found anythink online and after hours I solved this issue by adding the line (-ltesseract) to the Build Settings -> Other Linker Flags in xCode