How do I include the static library for Core Plot? - iphone

According to the Core Plot Wiki:
Core Plot is built as a static library
for iPhone, so you'll need to drag the
libCorePlot-CocoaTouch.a static
library from under the
CorePlot-CocoaTouch.xcodeproj group to
your target's Link Binary With
Libraries folder.
I do not see the mentioned library, where might it be?

This is the location referred to in the integration instructions:
(source: sunsetlakesoftware.com)
This will show up as red until the library has been compiled, but you can still drag this library over to the Link Binary With Libraries build phase. If you follow the remainder of the instructions for setting this as a dependency for your application target, it will be built before your application is.
In the future, framework-specific questions like this might receive faster answers on the Core Plot mailing list.

Related

STOP using HAL in cubeIDE [duplicate]

This question already has answers here:
CMSIS & STM32, How to begin? [closed]
(2 answers)
Closed 1 year ago.
As I want to write an efficient program to use minimal RAM & Flash, I want to remove HAL library completely from my project & program only in registers.
I want to use cubeIDE for compiling & Debugging but I do not know how to remove HAL library from my project(It seems that HAL library created and attached to project by default when generating project).
Is there any practical way?
Best!
There is an option in STM32CubeIDE project generation which allows you to create empty projects.
The empty project comes with the following:
main.c : Mostly empty
syscalls.c : I don't know what it is for but probably useless.
sysmem.c : Implements _sbrk() function, which is used by malloc() & new()
startup_stm32[xxxxxxxx].s : Startup file in assembly. You can leave it as it is
[xxxxxx]_FLASH.ld : Linker script file. Most of the time, this can be left unchanged.
But you need some additional libraries & files.
CMSIS Library : This includes some core functions common to all Cortex M devices. The core library is header only, and it's the only one you need to get started. There are some additional CMSIS libraries, like the DSP library which you may need depending on your project requirements. I suggest downloading it from its official repository.
Official STM32 headers from ST : This is actually called STM32Cube[xx] (STM32CubeF4 for example) and includes the Cube & HAL framework you want to get rid off. But we're interested in CMSIS compliant device headers. You can delete the rest. It also includes a version of CMSIS which lags behind the official one. Since you can download the latest CMSIS from its official repository, you don't need the one included in Cube package. You can download the relevant package from ST. For example, this one is for F4 series.
Once you have the needed packages, you need to configure STM32CubeIDE such that your project uses the newly obtained libraries. Basically, you need to add some additional include directories and symbol definitions. And there is an additional system_stm32[xxxxx].c file, which can be found in STM32Cube package and needs to be included in your project.
Here you can find a somewhat related answer.
Here is an example STM32CubeIDE blinky project I've created for the Blue Pill board (STM32F103C8). It may be somewhat outdated but it's probably still useful.
The method I've described probably isn't very practical. Some people suggest creating a normal Cube & HAL project and than pruning the unused parts.

How to add external framework GPUImage framework? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I am developing iPhone application using iOS. I need to add GPUImage framework, i followed this url for adding purpose. http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
Now i drag and drop GPUImage xcodeproject file in my project. In this project product folder having libGPImage.a file. It showing empty folder, in this file missing. It showing like red color. I am unable to access GPUImage class files. why it is happening.
Thanks,
As others have commented, I have step-by-step instructions for framework installation on the main GitHub page. I'll reproduce those below:
Once you have the latest source code for the framework, it's fairly
straightforward to add it to your application. Start by dragging the
GPUImage.xcodeproj file into your application's Xcode project to embed
the framework in your project. Next, go to your application's target
and add GPUImage as a Target Dependency. Finally, you'll want to drag
the libGPUImage.a library from the GPUImage framework's Products
folder to the Link Binary With Libraries build phase in your
application's target.
GPUImage needs a few other frameworks to be linked into your
application, so you'll need to add the following as linked libraries
in your application target:
CoreMedia
CoreVideo
OpenGLES
AVFoundation
QuartzCore
You'll also need to find the framework headers, so within your
project's build settings set the Header Search Paths to the relative
path from your application to the framework/ subdirectory within the
GPUImage source directory. Make this header search path recursive.
To use the GPUImage classes within your application, simply include
the core framework header using the following:
#import "GPUImage.h"
As a note: if you run into the error "Unknown class GPUImageView in
Interface Builder" or the like when trying to build an interface with
Interface Builder, you may need to add -ObjC to your Other Linker
Flags in your project's build settings.
Also, if you need to deploy this to iOS 4.x, it appears that the
current version of Xcode (4.3) requires that you weak-link the Core
Video framework in your final application or you see crashes with the
message "Symbol not found: _CVOpenGLESTextureCacheCreate" when you
create an archive for upload to the App Store or for ad hoc
distribution. To do this, go to your project's Build Phases tab,
expand the Link Binary With Libraries group, and find
CoreVideo.framework in the list. Change the setting for it in the far
right of the list from Required to Optional.
Additionally, this is an ARC-enabled framework, so if you want to use
this within a manual reference counted application targeting iOS 4.x,
you'll need to add -fobjc-arc to your Other Linker Flags as well.
If you follow the steps in the first paragraph, when you drag the libGPUImage.a library from the Products folder into the Link Binary With Libraries build stage, it will indeed show up as red. The reason for this is that the static library has not been built yet at this stage. Don't worry about that, because if you follow the previous step of adding the project as a dependency of your application the static library will be built before your application is. Everything should work fine from this point on.
These are the installation instructions I've now used on several applications, and they've worked for each one.
Try this
projet Target > summary > framwork > add Others.> than browser to
"BradLarson-GPUImage-6619cd2/framework>GPUImage.xcodeproj" .
Thi url you provided is not working... anyways, did you try to add *.a file into your project by adding it in the build settings of your target?
You need to follow instruction to add Framework in your project, you can check those under "Adding the framework to your iOS project" section in-
https://github.com/BradLarson/GPUImage

how to create a static library or framework from a already available source code in iOS

My clients wants to use some of the already available features in my app into their app. But, i dont want to share my source code with them and vice versa. I found out from some googling that, we can do this by creating some static libraries or frameworks in iOS. Can anyone throw some light on how to create a static library or framework (which ever is better) out of my already available source code.
My preference is to use static libraries over Frameworks. You will provide your customers the library file (.a extension) and the header file(s) for the functions in it. They just need to install the files somewhere in their project tree, set the include path, add the library to the project and they are good to go.
Note that if you want them to use your lib in the Simulator as well as on device you will need to provide them two versions of the library, one for each.
For instructions on how to create and use an iOS static library see this site.
Just for your information:
I created a static framework for iOS according to jverkoey's instruction
A ton of thanks to Diney Bomfim for his excellent article on how to create a framework. This is exactly what i am looking for.
EDIT - The Link is NOT working anymore...

Compile C library as iPhone framework?

Each C/C++ library has some amount of headers that should be used with that library. And if you're use more than 1-2 libraries, custom header paths is kind of headache.
So I thought: is there a way to compile C libraries as frameworks. Static library + headers + versioning.
I found in XCode template for Cocoa framework but nothing about iPhone framework building. This simple step could allow developers to build and share between each other frameworks with some interesting code.
Also it would be great to use libpng, libjpeg and other libraries packaged as frameworks.
I won't use dynamic libraries in those frameworks. Only static version will be present.
I combined techniques I found here and here into my open source library here (NOTE - I have since removed the relevant scripts from this project. I have updated the link to point to the last revision that included these techniques.). Think that's basically the solution you're looking for.
Basically, it has a target that will build a fat static library (lipo builds for arm6, arm7 and i386). It has another target that takes that library and builds it into a framework.
There's no reason you can't use the same techniques for a C project. In fact I've started work on porting C the VTD XML parser to an Objective C framework using the same techniques.
Frameworks are basically just bundles of dynamic/shared libraries. Since this is not allowed in the App Store, you have to build static libraries and link them with your App's executable at compile time.
However, to ease the pain a little, you can have a Xcode project for each library and compile each library into a static lib. Another way would be to put all required source files into the main Xcode project and configure it appropriately so it all builds at once (I did this with small libraries like Minizip, for instance).
Hope that helps.
the problem you are trying to make already exists - it's called DLL hell
Best way is to stick with plain old static libraries when making small apps and organizing source/headers structure

Considerations for including library as binary vs source

I'm trying to write an SSH client for the iPhone, and I'd like to use the libssh2 open source library to do so. It's written in C.
How should I include this C library for my iPhone app? Should I compile it into some binary that I include into the my app, or do I add all the source to my project and try to compile it along with the rest of my app?
I'm interpretting this question as:
"Should I compile the C library code once, and include the binary library in my project? Or should I include all the source and compile it every time I build my app?"
It depends. One of the projects I work one depends on several external libraries. Basically, we have a simple rule:
Do you think you will need to change code in the C library often?
If you will be changing the code, or updating versions often, include the source and build it with the rest of your project.
If you're not going to change the code often or at all, it might make sense to just include the pre-built binary in your project.
Depending on the size of the library, you may want to set it up as a distinct target in your project, or for even more flexibility, as a sub-project of your main project.
If I was in your place, I would build libssh2 ahead of time and just include the binary library in my iPhone project. I would still keep the libssh2 source around, of course, in case it does need to be re-built down the road.
I have an iPhone app that is 90% c. I have had no problem adding 3rd party sources to my project and compiling. I am using Lua, zLib, and libpng with no modifications. I've also included standard libraries like unistd and libgen and they just work™
The Three20 iPhone library has a great howto on adding their library to your xcode project. Give that a shot.
I think you will find in the long run you will be better off building it into a standalone library and linking it with your application. This makes it easier to integrate into future apps. Another benefit is that it encourages code separation. If you feel pretty confident with the library, you can link your debug exe to the release build of the library and get some extra performance.
I can't really think of any downsides to creating a library, after the initial cost of setting it up, and having an extra project to modify if you have some changes that need to be made to all your projects. Even if you don't know how to make a library for the iPhone, this is a good excuse to learn.
Just adding the source to you project should work fine as well.