Compiling Speex successful on iPhone simulator but failed on iOS device - iphone

I tried to compile Speex library on iOS following this tutorial and succeeded to do it in the iPhone simulator, but the build fails on a real device. I get some errors like "Use of undeclared identifier __m128", which looks like there are some problems with compiling C/C++ sources on a real device. I would be very thankful if someone could propose a solution.
Here is also my source code: https://github.com/artem888/SpeexTest
Artem

Fixed the problem:
Needed to uncomment #define _USE_SSE in config.h , after that lib compiles and runs successfully.
Many thanks to Cliff's tutorials:
http://codeforfun.wordpress.com/2010/04/29/compile-speex-for-iphone/
http://codeforfun.wordpress.com/2010/11/11/speex-on-iphone-explained/
http://codeforfun.wordpress.com/2010/12/07/speex-on-iphone-explained-part-ii/

You can find a precompiled Speex library for iOS on github here: http://bit.ly/151x6E2
You'll also need the Ogg library. You can find that here: http://bit.ly/P40pxG
If you don't like using precompiled libraries, each of the above repositories now contain scripts to allow you to reproduce the builds. These rely on some additional utility scripts: http://bit.ly/19cYCQj
I have just updated the repository for arm64!

Related

How to Install and use FANN with Xcode

i want to use FANN (fast artificial neural network) with Xcode
i googled for a way how to get the FANN and install it in Xcode but i did not find a result
please guys does anyone know from where can i download FANN library and use it with Xcode
thanks
Go to http://leenissen.dk. Here you will find the source code you can download from sourceforge.com and install instructions for Cmake on the command line. Just follow the instructions and you will see several static libraries were included. Now all you will have to do is add the library you want to use and the include (.h) files to your Xcode project. From here the example code from the FANN website should work.
Note that when you reference the FANN .h files to your projects files you must use include and not import. I ran into this problem myself.
There was a issue with exporting a code signed application using Xcode. I was able to find a solution after playing around with code signing.
I decided to try manually code signing my app with instructions from http://www.digicert.com/code-signing/mac-os-codesign-tool.htm. This did not work. However the code signing tool pointed me to a problem with libfann.2.2.0.dylib. So I checked if libfann.2.2.0.dylib was code signed and it was not. When I saw this I thought I would try code signing libfann.2.2.0.dylib with my developer ID and re-importing it into my project. This strategy worked and I was able to export a developer ID signed version of my application.

XCode iOS - Need help on Compiling C Error

I'm trying include this barcode source code Stefanhafeneger - Barcode github.com to my project because this is the only DataMatrix library for iOS I can find so far. I have no problem compile and run the source code on xcode 4.2 but when i try to use the library in my project. I received quite lots of error as follows.
After some surfing, i found that they were foundation error which i think is cause by the .C files for example file - dmtx.c it is under libdmtx library.
When i remove the library for debugging all error were gone and left 'dmtx.h' file not found so i think xcode does regconized these files. Any idea to compile these C files?
Many Thanks
Kin
My assumption is that you did not have the Foundation.framework instanciated in your project...
My mistake, the problem was cause by my prefix file.

DYLD_INSERT_LIBRARIES and iPhone

I understand that Apple doesn't support using dynamic libraries in iPhone applications. But we are working on a in-house application and we have a unique requirement to use the dynamic libraries. Our requirement is to load a dynamic library as part of "iPhone" application start up. I read that DYLD_INSERT_LIBRARIES is meant for this purpose. So I edited the Info.plist and added below entry.
LSEnvironment
DYLD_INSERT_LIBRARIES
#executable_path/sample.dylib
But it does not seem to be working. Can you please let me know your thoughts ? Really appreciate your help in this regard.
Thanks
--Neo
I've found a way to successfully add LC_LOAD_DYLIB load command to a MachO binary using optool.
$ optool install -c load -p "#executable_path/<dylib_path>" -t <executable>
$ otool -L <executable>
When building optool, make sure that build setting OTHER_LDFLAGS includes -ObjC.
optool does not seem to be able to successfully add load commands for arm64 architectures, so you may want to remove arm64 from the binary
$ lipo <input_file> -remove arm64 -output <output_file>
Edit:
There is an open pull request with support for arm64.
I also working on the same problems for last few days. I also didn't succeed to do it the way you try. So I try to launch my app from another app using this link:
Dynamic Library injection
,unfortunately Apple Block running multiple tasks (even on iphone simulators) but you can try maybe you will have more luck. I know its not a answer you expect but maybe it will give you some way to think. Please share if you have some progress.
You "could" load a binary at runtime and you can manipulate xcode settings to make it compile dylibs for iOS. See this answer:
https://stackoverflow.com/a/10509453/784387
Happy to be corrected, but dylibs are not supported and will not work. You need to get the code for the libraries and compile them into a static lib for the arm6/7 architecture. Then you can easily include these libs. There are plenty of examples of static libs and XCode also provides targets for building them.

How to compile third party c library in Xcode?

i tried to do a sip client for iphone.
I tried to use oSip or eXosip2 , i download their package ,and compile it using "./configure""make""make install "
I get some *.a library, and i include there headers.
When i compile it , their is warning , this *.a library formate doesn't support !
It's really annoying, what should i do to make it work ?
Should i include their code ,and compile in xcode ,tried to build a static library ?
somebody tell me ,how to deal with some C librarys.
I see some topics talk about how to make a library in xcode . The problem is , if it is C library , it was already done, no need to build in xcode ,it's already their ,just make to build it . Whatif the *.a library doesn't support ,what should i do ??
PS: I was already doing the static library ,not dynamically. It's not a chooice between dynamically and static . It's all about x86_64 PC LIB is not suitable for i386 iphone.
You can't dynamically link on the iPhone; it has to be static linking.
Should i include their code ,and compile in xcode ,tried to build a static library ?
Yes, I think so.
Maybe have a look at this previous question: How do I add a third party Framework to iPhone project?
In order to compile for iOS, you should create an xcode project. It will be much easier to use, maintain and debug.
You can download here my osip/exosip/c-ares xcode project.
The above also requires c-ares which is an important dependancy for eXosip2.
PS: minor update may be required to compile git version. Just add/remove new/old files.

XCode linker error : library not found for -lAdMobDevice

I am trying to build lite version of my iPhone application using AdMob. I followed the guidelines here http://www.iphonedevsdk.com/forum/iphone-sdk-development/11358-creating-lite-version-app.html and created two different targets. In the lite version I added a macro called LITEVERSION which I am checking using #ifdef and doing the appropriate things.
But when I build the lite version of the app, I get a linker error
ld: library not found for -lAdMobDevice
collect2: ld returned 1 exit status
However I am able to build the full version without any issues and also noticed that build is working fine (for the fullversion) even if I remove the #ifdef macros. This suggests that the libAdMobSimulator.a library is linking properly for the full version however it fails on the lite version.
Any pointers would be greatly appreciated!
Cheers
Jugs
When I had this problem, the cause was that I'd added the library into Xcode by dragging it in like a regular source file.
The fix was to remove it, and then add it properly using the "Add->Existing Frameworks..." dialogue.
I got similar error as I was using CocoaPods libraries
library not found for -lPods-MyApp
I got the error because I opened xcode project instead of workspace.
I was using CocoaPods, and ran pod install, and that fixed it.
I figured out what he problem was. I just removed all frameworks and libraries and added them back in for both the targets and it worked!
Cheers
I cause this because of a libray libMobClickLibrary.a which is used in youmeng sdk missed. I fix the issued after copy libMobClickLibrary.a to the project floder.
I had the same problem with Google Analytics library. My problem was that I forgot to add the path to the Library Search Paths in my target's build settings. (Target -> Build Settings -> Library Search Paths)