I have been trying to integrate GSL (Gnu Scientific Library) into an iPhone project using Xcode.
The challenge is GSL has all the modules in different folders, yet when their header files are reference, they often reference instead of or .
At least with I could use Xcode's recursive header file search to find it. But with , basically file not found.
Does anyone have an easy way to address the hierarchical GSL structure to compile into Xcode?
I can do it the tedious way of fixing all the #INCLUDE lines but hoping there is a better alternative. This way, I can more easily update GSL when changes are made by the community.
NOTE: I found Xcode needs to find the right header file locations (make sure to adjust your TARGET Build settings, not just your Project Build settings).
You may be able to use grep and sed to replace all of the header lines in the gsl package.
Using grep and sed to find and replace a string
Related
I'm trying to build with the LAME files but I'm getting these errors on the machine.h file
What's going on?
Short answer : your defines are not what they are supposed to be. The BB10 SDK provides stdlib.h and string.h so you should either :
add a #define STDC_HEADERS 1 somewhere in the include path (inside version.h maybe, because it's seems to be included by everyone else)
add DEFINES += STDC_HEADERS to your .pro file.
You are trying to build your library inside Momentics.
That's usually the fastest way to go.
The issue is that you are skipping the whole configure part of Lame compilation, which was supposed to gather insight about the system you're trying to compile on by trial and error.
I haven't looked at Lame specificaly, but usually configure either creates an header file with all the right defines or add them in the Makefile it creates as arguments to the compiler.
Momentics, on the other way, compiles all .c|.cpp file and link them all together using qmake to handle all Qt specific bits. Momentics sets the right environment, and then there is a lot of scripts to handle all the BB10 processes (package, sign, ..).
So you'll have to provide the missing parts. Usually it's faster to create a new config.h from scratch, but sometimes you may want to use a console with the BB10 SDK environment and do a ./configure manually. Don't forget that the simulator is x86 and the real thing is ARM, so you will have take care of that too (Endianness/optimization issues).
I am struggling from past 1 week that how to compile the tesseract ocr enging for iphone. I have gon through through some link, But i couldn't find the proper way. Can anyone help me through step by step procedure. Thanks in advance.
I will have to agree with you on this that it is not an easy task, but the below links finally helped me achieve this... hoping this helps..
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
That probably won't be enough. I know nothing about Tesseract OCR library but you will require the include directives, plus specify the directory to where the Tesseract header files are installed via a compiler switch (usually -I) and (possibly) link with the Tesseract library file(s).
That would be enough to compile the sources if the header files are installed into common include directories. However, if the header files do not contain the definitions (not just declarations) for all functions/variables then there will be a library file(s) (like libtesseract.a or/and libtesseract.so) that must be linked in order to compile your binary.
I am trying to create an app that will allow me to stream video FROM the iPhone TO a server. my current theory as to how to do this is to create a series of FFMpeg files and send them to the server. as far as i can tell i have compiled the FFMpeg library correctly for the iPhone.
i followed these instructions here. a series of executable files appeared in the folder so i'm assuming it worked.
my question is now what? how do i get these into an app? how do i make calls to these executable files? and most importantly will this even work the way i want it to?
You have built the ffmpeg binary which can run on an iPhone. You cannot run executables from an app on a (non-jailbroken) phone. So you would have to compile the library, and link against that. Then, from your app, call the relevant functions directly, mimicing what the ffmpeg program does.
Althought this issue is quite old this could help to other users in the future:
Just take a look at the source code here http://dev.wunderground.com/support/wunderradio/wunderradio.1.9lgpl.zip
Good luck
Ok you said that you succesfully compiled FFMpeg for iPhone, right? As mvds said, you can't use them as executable files. So in order to use this libraries after compilation finishes you need to copy all the .a libs generated to your project (as when you add libraries or other frameworks). These libraries are:
libavcodec.a
libavfilter.a
libavutil.a
libswscale.a
libavdevice.a
libavformat.a
libswresample.a
Then you have to configure your project
Clic on your project -> build settings
Search "Header Search Paths" and add the folder location of your libraries (location can be absolute or relative)
Clic on build phases -> Link Binary With Libraries -> Add other, and add all .a files
Voila! Now you can import and use the libraries of FFmpeg for your project
#include <avcodec.h>
#include ...
// More C and/or Objective-C Code
To access individual uncompressed frames you can use captureOutput:didOutputSampleBuffer:fromConnection: delegate method from AVCaptureVideoDataOutput (there are plenty of examples), and somehow encoding them to h264 maybe using AVFrame? As far as I know FFmpeg also can stream using RTSP for live streaming, but it seems that documentation is close to zero :(
To answer your final question
and most importantly will this even work the way i want it to?
The answer is yes, it can work, I found 2 libraries that do just what you want to achieve
http://www.foxitsolutions.com/iphone_h264_sdk.html
http://ios-rtmp-library.com
Both uses FFmpeg the same way you are suggesting, this question is a little old but I have found many users trying to achieve this so so I have a question Do you had success on doing this? Can you share your experience or recomendations?
I have found an existing open source library that I would like to include in my iPhone project (the unrar source code found here: http://www.rarlab.com/rar_add.htm ).
I have compiled this source as a linked library on my Mac with "make lib" which creates the libunrar.so file just fine.
These are the makefile settings for that target:
lib: WHAT=RARDLL
lib: $(OBJECTS) $(LIB_OBJ)
#rm -f libunrar.so
$(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
Obviously I can't use this on iPhone but I imagine I should be able to compile with different options to make a static library that I can use.
Do I:
Compile it on the Mac with different make options then drag the resulting library (some kind of .a ?) into my xcode project?
or
Drag all of the source code into my xcode project and create special targets of some kind to create it?
or
Something else entirely different?
I've been working on solving my unrar problem for a couple of weeks now and I believe using this library will give me the best results but I just don't know the final steps to make use of it.
Thanks for all advice.
I think that you'll probably want to do the easiest thing first, create an empty iPhone project and bring all of the code into it, just to see if it will compile.
If so, you may want to use the empty project to aid in the development of an Objective-C wrapper, once that is complete you can bring the code into your existing project for integration and testing.
If it looks like this is code that you would like to use with other projects, or you are feeling giving and would like to provide an iPhone port of the code, go ahead and pull this together into a library.
Here is a site that documents the process.
I realise that the view/controller stuff will be different between Mac and IPhone apps but the model code may well be similar/the same. So whats the best way to organise a project(s) so that the model code is/can be shared?
Copy/paste - just duplicate it and manually keep it in sync
Have 2 xcode projects point at the same workarea - one for Mac and one for IPhone and share the code.
Common library - presumably you can't do this (or can you)
Thanks for any tips.
There are a few ways to do this. The first thing you can do is is create a project that builds as a framework on Mac OS X. Since you cannot use frameworks on iPhone, you can make static library target that contains the same code files. That basically works, but the header paths will be different. If you want the header paths to be the the same (i.e. <Myframework/MyFramework.h>) you will need to modify the the install path of the static library headers so that they are copied into "$SDK_ROOT/usr/local/include/MyFramework", and make sure /usr/local/include is an included header search path. You will then need to install the library and headers into each SDK_ROOT.
I started out doing the above, but I found it to be a royal pain. So I ended up doing something that is a variant of #2. Basically, I get the header paths to be equivalent by making a directory named "Externals" in my iPhone project root, then a directory named with the appropriate name ("MyFramework") in the externals folder. That is the folder I copy I drag the framework files into.Findally I add the Externals folder as a system header path (which is admittedly sort of a gross hack). You need to manually add new files to the iPhone project, but I have found that to be less of a pain the installing static libs into my build root.
I'm not sure if the suggestion from the previous answer would work. If you look at my previous question, you'll see that I've failed to load a custom framework on the iPhone even though the framework works fine on Mac.
I would go with method 2.
You could develop your application in JavaScript, CSS, and HTML. You would use the WebView and UIWebView objects on the Mac and the iPhone respectively. You can do pretty much anything you want in the WebView objects, even make calls down to Objective-C.
The QuickConnectiPhone installer, found here https://sourceforge.net/projects/quickconnect/, installs QuickConnectMac and QuickConnectiPhone templates into Xcode.
This way you can quickly create an application in one environment and then migrate the view to the other. In fact the QuickConnect framework is highly modular.
If you don't want to develop in JavaScript the same modular framework is found on the Objective-C side of the templates installed.
It should make it much easier for you to do what you are attempting.