Connecting Tech Pros Worldwide Forums | Help | Site Map

using third party libraries in c/c++

Newbie
 
Join Date: Jun 2007
Posts: 1
#1: Jun 25 '07
Hello, i have studied both c and c++ at university (although by no means have they been extensive, one semester each) and i feel i have a fairly good understanding of the basics of these languages. My problem is i always have trouble using third party libraries in my own code. I am currently trying to use the FFTW library for learning DSP and also c++, but i can't get it to work, and i cant find any info on how exactly to import the library or any library for that matter. It is a c library, and the examples just use one header file. But the FFTW download comes with hundred of .c and .h files and i dont know where to begin! importing that header file does not enable me to use the functions in the example code. if anyone has used this library, or can direct me to places where i can learn how to import it, or any libraries for that matter, i would greatly appreciate it!
Thanks!

Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,366
#2: Jun 25 '07

re: using third party libraries in c/c++


The reason you are getting all those .c files is that a library compiled for Unix won't work on Windows.

First, corral all those .c files into an IDE project that builds a library and compile them to get your library. There are probably instructions about how to do this since the Unix, Linus, and Windows libraries are all different. You need to compile for your target OS. In fact, there may be a makefile in there you didn't see. maybe you just need to run make or nmake on that makefile with the correct switches set.

Second, in your application use the library header file with the #include.

Third, set the properties of your project so that the library you compiled is added to the list of addtional dependencies for the linker. That is how the library gets added to your application build. You may also need to specify the path to your library.
Reply