How to use Port Audio Libaray in XCode? - xcode

How to use libportaudio.a library in Xcode?
First of all when I build port audio library it's type is represented as document by the Finder. When I add libportaudio.a to my Xcode projects , How should I use it in Xcode ? Is libportaudio.a enogh for using it in Xcode?
How to Include and use it in Xcode without getting errors?
Anyone who used port audio library in XCode successfully could do me a big favour and save me from a lot of troubles.
Thanks

According to the docs you must include portaudio.h and libportaudio.a to use the portaudio api. When I built portaudio it placed these files in /usr/local/include/ and /usr/local/lib/ respectively. I got my project to build by adding these paths to the Header Search Paths field in the project Build Settings tab.

Related

Adding swift framework extracted from IPA

I'm trying to run an IOS app created by another dev that is using a cocoapod from a private repository I have no access to. I managed to extract the .framework bundle from the IPA and add it to the xcode project but it is not being recognized (I get "No such module").
Is it possible to do what I'm trying to achieve?
So far, what I've tried:
build it in release as I guess the framework in the IPA is in release
add the .framework as embedded binary
add the .framework as Linked Framework and Libraries
copy the .framework to ~/System/Library/Framework
update the Frameworks Search Path including $(SRCROOT), recursive, hardcoded paths, etc.
change the .framework location to "Relative to Build Products"
Thanks!
It wasn't that much easy to get the frameworks used in project from ipa file.
Whenver the application runs for first time, also when you archive your application, all the linked .frameworks will get converted to .dylib that is dynamic libraries.
What is static library - a unit of code linked at compile time, which does not change.
What is dynamic library - a unit of code and/or assets linked at runtime that may change.
Framework - A framework is a hierarchical directory that encapsulates a dynamic library, header files, and resources, such as storyboards, image files, and localized strings, into a single package. Apps using frameworks need to embed the framework in the app's bundle.
Dynamic Library
A dynamic lib file is just resides inside the framework folder.
Following is a description from apple documentation
Dynamic libraries outside
of a framework bundle, which typically have the file extension .dylib,
are not supported on iOS, watchOS, or tvOS, except for the system
Swift libraries provided by Xcode.
Ref: Documentation
So you cannot simply copy a .dylib to xcode bundle and just use it. There is some sort of security too.
Another approch
It is possible to decompile the source code from .ipa files. You will get idea from below links.
SO Question regarding decompiling of ipa file
Decompilation Possibility
It seems that when an app is archived for distribution, the Headers and Modules folders are removed from the .framework bundle.
The Header folder contains the .h headers for Objective-C and the Modules folder contains the .swiftmodule equivalent files for Swift.
Without these files you have no public API to consume for the framework binary, so unfortunately this renders the frameworks unusable without reverse engineering.

Using libusb in open frameworks on OS X

I wanted to try some things with openFrameworks but got stuck trying to use libusb, which is not available as of addon.
I copied it in the "other" folder but don't no how to include it in the project.
The included ofxKinect addon includes compiled libusb and headers. If you add that add-on via the project generator, you'll have access to libusb.

Override system library in Xcode

I am trying to override the headers that Xcode uses for a specific third party library because the one bundled with OS X / Xcode is out of date and am having trouble getting Xcode to choose the correct headers.
Right now the library is included via #include <pcap/pcap.h>. I can't change this because the code is cross platform and this is where the library should be. I have the latest version of the libpcap library headers located at ~/software/pcap/. Including ~/software/ in the "Header Search Paths" results in my other third party libraries (that don't exist at the system level) being found and used, but Xcode is still using the bundled/internal (old) version of the libpcap headers. I've tried adjusting the order in which the "Header Search Paths" list is set up with no luck.
I've tried "always search user paths" but this results in dozens and dozens of other local project headers being substituted for system/other library headers. I only want the headers for this specific library to override the system ones.
Is there a way to force Xcode to use a non-bundled set of library headers in place of the bundled ones for a single specific library?
It seems that Xcode does not follow aliases. Replacing the alias with actual files & folders and ensuring that the "Header Search Path" order has your overridden files listed before the Xcode level ones seems to resolve this issue.

Xcode: How do I include a framework in my application

I am new to Xcode programming and have finished my first game wich uses SDL. When starting it on another mac it didn't work until I added the SDL2.framework into the /Library/Framework directory. Now I've been searching forever on how I could include the framework in the app because I didn't want to install the SDL2.framework on every mac I wanted to play the game on but I didn't find anything that worked… I've found something like "turn off ZeroLink" but didn't find it in Xcode… What setting do I have to change so Xcode will include the framework in the finished .app?
The following tutorial details setting up an SDL project in Xcode and the final, optional section, covers packaging the framework with the app
http://zamma.co.uk/setup-sdl2-in-xcode-osx/
Essentially what you need to do is:
Create a Copy Files entry in the build phases
Set the Destination field to be Frameworks
Add the SDL2.framework in the list to be copied
Set the parameter Runpath Search Paths (under Linking in the Build Settings) to be #executable_path/../Frameworks

Using FreeImage with Xcode

I'm writing an application in which I want to use free image to load files. I am on MacOSX 10.8.2 and I am using the mac ports version of free image. I had it working, but when I tried putting it on another computer without the port, it wouldn't run because it didn't have the files. The macports version comes with a dylib, can I use that to run it without downloading the port? If I can how would I compile it with the project because I have tried linking it as a Binary Library, but I can't include the files. Any help would be appreciated, as I have bee at this for a few hours now.
Thanks
You can actually build the FreeImage library as a static library. Unfortunately, the downloadable source from the http://freeimage.sourceforge.net/download.html website uses makefiles that are expecting to use the older SDKs for Xcode3.
I actually updated the Makefile.osx to build with Xcode4 using the 10.7 SDK and posted the change to https://gist.github.com/AhiyaHiya/5105571
You should be able to run this make from Terminal.app and create your .dylib and .a files for your needs.

Resources