How to link static library with xcode? - ios6

I have built ffmpeg and link it to my project:
But when I include libavformat.h , it game me error:
I want to know what's the settings I am missing ?

You should add the header files to your header search path in the Build settings and just use #import "avformat.h".

Related

Eclipse for C/C++ header file not found

I got a C project with a Makefile.
I import the project to eclipse for C/C++(Neon.3 Release (4.6.3))
But when build the project, eclipse cannot find some of the header files.
I have installed the pcap lib in my system.
apt-get install libpcap-dev
but, I can use make command to compile the C project.
Can anyone tell me how to solve this problem in eclipse?
For CDT projects, you can define include paths and preprocessor symbols for the parser.
If Autodiscovery is enabled, after a build finishes, any discovered paths and symbols will be displayed in the Discovered Paths section.
You can also define the properties on a per project basis in the C/C++ Projects or Navigator views.
To add include paths and symbols:
To set properties for your project, right-click your CDT project and select Properties. Alternatively, to set properties for a specific source file in your project, right-click a source file within your make project and select Properties.
Expand C/C++ General and select Paths and Symbols.
Click Add to define new element (Include Path, Symbol, Library path etc).
Click Edit to change selected element (Include Path, Symbol, Library path etc).
Click Delete to remove selected element (Include Path, Symbol, Library path etc).
Click Export to make selected element (Include Path, Symbol, Library path etc) exported.
Click Unexport to remove selected element (Include Path, Symbol, Library path etc) from export list.
Click Move up and Move down to set elements (Include Paths, Library paths etc) order.

CodeBlocks header common folder

I have multiple projects which have the same header files over and over again, is it possible to create a common utils folder with all the headers and their source files?
Project files with header files
Yes, you can. First make a folder and insert all of your header file in that folder. then create a makefile and you can add that folder for the headers in a Makefile. See here
Other option can be to give path in include like
#include "../Headers/check.h"
#include "../Headers/stackstring.h"

Using external static library in LPCXpresso

I am using the LPCXpresso IDE to program my microcontroller to use the libjpeg library for a particular application. However, I cannot seem to get the LPCXpresso IDE to recognize libjpeg. The way I see it, there are two options:
1) Take the jpeglib.a file, include it as an external library, and then attempt to import jpeglib.h. I have tried this, at the IDE still does not recognize jpeglib.h.
2) Create a new static library from the libjpeg source code. Is this my only option? It seems a bit excessive.
Any tips regarding adding/linking external libraries in LPCXpresso would be greatly appreciated. Thanks!
You can easily add a library to Eclipse/LPCXpresso by creating a new project (not a C project or a LPCXpresso project but a 'normal' project) by clicking File->New->Project. Name is as you wish, let's say 'JPEG'. Add your library file to it under the folder 'lib' (you have to create the folder first). Call the library file 'libJPEG.a'. Also include the header file under the folder 'inc'. It is not mandatory to create these folders by the way, but it makes it all more organised.
The edit the properties of the project that's needs to include the header and library. Right click the project and choose properties. Go to C/C++ Build->Settings->MCU C compiler->Includes and add the include path of the inc folder of the library project. The go to C/C++ Build->Settings->MCU Linker->Libraries and add the library file WITHOUT the lib in front of the file name, hence just JPEG. Also add the library search path below (point to the lib folder).
That's all!

How to include a js Library within a CakePHP Plugin

can anyone tell me how to include a js Library within a CakePHP Plugin ?
In the root app/ folder I can do it in the Config/assets.php but where do I include it in a Plugin ?
The Library which I want to include is located in /app/Plugin/MyModule/webtoor/js/lib/
You can use blocks for scripts and CSS files. More info here: http://book.cakephp.org/2.0/en/views.html#using-blocks-for-script-and-css-files
Short answer:
// in your view
$this->Html->script('/pluginName/js/lib/whatever', array('block' => 'scriptBottom'));
// in your layout
echo $this->fetch('scriptBottom');
This should do the trick.

How can I import compiled C++ libraries into an Objective-C++ project in Xcode 4?

I'm trying to use the SkypeKit SDK to create an Objective-C++ project using Xcode 4. I have two compiled libraries from SkypeKit, libskypekit_cyassl_lib.a and libskypekit_cppwrapper_2_lib.a, which I need to be able to use so as to access the Skype API.
I've added in both .a files under 'Linked Frameworks and Libraries' and added -all_load -ObjC -lstdc++ to the 'Other Linker Flags', and that builds okay, but as soon as I try to use any of the methods in those libraries, building fails.
Any help would be greatly appreciated, thank you!
You can call C++ code from Objective-C++, which means that your files should have the .mm extension instead of .m
I assume that this could be the issue, but since you did not specify the errors you get it is just a guess. Specifically, if you call C++ code from a .m file you get compilation errors.
Another possible cause is forgetting to import the header files of the library. For the import to be successful, you also have to add the directory where the headers are to your project "header search path".
If this does not help, please post the error message.

Resources