How to add libraries to c code in XCode 4.4 - c

I am having some trouble adding library path inside XCode. I am writing C code.
I have both my code and the library I want to add. But I have trouble adding the library, say a math library I want to use. I think the path is not set correctly. I do not know how to set paths inside XCode.
Would anyone know or have an example of how to add libraries to a C code? I am using the current version: XCode 4.4.1.
Thanks in advance!

Related

xcode c include files

I would like to use XCode 4 as IDE for my C program.
I am using few libraries, which are not installed in system paths. Also, I am using external program for building (waf).
So, basically, I need XCode for everything, except building.
But I can't figure out how to tell XCode where my library include files are for it to be able to autocomplete functions and everything from that libraries?
In the build settings for the Target - look for the HEADER_SEARCH_PATHS setting.
Have you added the library headers to the project? You can just add them by reference.

Using OpenCV2.2 with Code::Blocks 10.05. Error: ld.exe cannot find -lhighgui

I'm trying to build a simple webcam application in C++. I'm using wxWidget for GUI and OpenCV for image and video operations. But I'm having trouble setting up OpenCV on my IDE. When i try to run a sample code, or any code for that matter, I get an error that says:
ld.exe cannot find -lhighgui
I'v properly given the library and include links to the IDE. OpenCV's path is also added, I checked. I even tried linking each library file individually but id didnt work.
Please Help. :)
I'm using Windows 7 Professional X64 and Code::Blocks 10.05
Any kind of help will be appreciated.
--Aayush Shrestha
OpenCV library files have been renamed with version 2.2. You can link to the new library opencv_highgui instead of highgui.
You also need to do this for other OpenCV libraries you use.

Compiling with a multi-precision math library in C using Code::Blocks on Windows

I'm having a lot of trouble figuring out how to do this. I need an arbitrary precision library for math in C. I'm good with either CLN or PARI/GP, both of which I've installed. I'm using Windows, so I had to do this via Cygwin, and ran the ./Configure files, followed by make install.
Everything's built, but I cannot figure out how to link it all and use it. I'm using Code::Blocks, and anytime I try to include the necessary header files, there are loads of errors. I also link the .a file with the library, but no help either. The header files create far too many errors.
Could anyone give me a run through on how I can make this work?

Compiling C code as static library for use in iPhone app?

Pardon me if this is a "noob" question, I'm overextending myself a bit with this.
I'm trying to compile a library written in C for use in an iPhone app I'm developing. I can't seem to figure out how to do this, and I've been searching and trying things for hours.
I've tried using an External Build System project, and selecting the folder where the makefile.in.am.mingw are.
I've tried creating a Static Library project and adding the header\source files to the project. Which looked good until I tried to compile and got 260k+ errors.
When I 'cd' to the directory with the makefiles and type 'make' I get:
No targets specified and no makefile found. Stop.
I have no idea how makefiles work, I just want to use the library!
Is there a simple way to do this? If someone could at least point me in the right direction, I would be quite appreciative.
The makefiles you have are for GNU automake (under MINGW by the look of it). Even if you get them working (automake can be tricky, but it is included in Mac OS X's development thankfully), it probably won't help you much in building an iPhone library.
I did this with an existing C library by creating a new framework target in Xcode with the right include settings, etc gleaned from looking at the makefiles. That created a .framework bundle with headers and an iPhone .a library ready to be used by an iPhone project. You could also just import the C source into the iPhone project, and have it compiled in that way which would probably be quicker.

Linking libsox in Windows

can anyone help me with linking libsox to my program in Windows? I have made a static library libsox.lib according to directions in INSTALL file in sox 14.2.0 source code version. Is there any way to build a dynamic library? I think it should be easier way...
What language are you using?
How are you currently building and linking the library?
This link gives some info on linking libraries in VC++ under windows, but without more info from you no-one will be able to help

Resources