Home » U++ TheIDE » U++ TheIDE: Packages » How to use third party libraries? (Newbie alert!)
How to use third party libraries? (Newbie alert!) [message #3072] |
Sat, 06 May 2006 00:00 |
Alatius
Messages: 2 Registered: May 2006
|
Junior Member |
|
|
This question may sound a bit naive, but I hope you can bear with me, and that you, in case my question demands too long an answer, at least may be able to point me in the right direction... For you to understand my question better, it should be noted that, while I am not new to programming, I have never developed a GUI application in C++ before, or for that matter any moderately complicated project. My understanding of, for example, the inner working of the process of "linking" files, is what I describe as sketchy, at best. On top of this, I have just recently switched to Linux (Ubuntu), so I am a bit of a newbie in that regard as well.
Anyhow, my question is, simply, how do I make use of a third party library in my project? To take a concrete example, I want to use functions provided by the libsndfile library (http://www.mega-nerd.com/libsndfile/), (which is written in C, but I hope that won't be a problem). Instead of downloading the tar-file from that site, I installed the library through Synaptic (Ubuntu's package manager), specifically the packages libsndfile1 and libsndfile1-dev. So far, so good (I guess.) Of the files that got installed on my system, I guess these are relevant:
From libsndfile1 (is it necessary, by the way?):
/usr/lib/libsndfile.so.1.0.10
/usr/lib/libsndfile.so.1
From libsndfile1-dev:
/usr/include/sndfile.h
/usr/lib/libsndfile.a
/usr/lib/libsndfile.la
/usr/lib/libsndfile.so
/usr/lib/pkgconfig
/usr/lib/pkgconfig/sndfile.pc
Now, when I want to use this library, I start to get problems though. I tried to add
#include <sndfile.h>
to the top of my main.cpp, but this alone won't quite do it, it seems, as, during the linking phase, I get some errors:
"Linking...
/home/alatius/upp/out/test1/GCC32.Debug_full.Gui.Main.Shared /main.o: In function "test1":
/home/alatius/upp/MyApps/test1/main.cpp:236: undefined reference to `sf_command'
/home/alatius/upp/MyApps/test1/main.cpp:236: undefined reference to `sf_command'
collect2: ld returned 1 exit status"
(Here, line 236 contains the call "sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer));", copied straight from the sndlib documentation.)
Well, I don't really know what to do now, I'm afraid. Do I have to somehow add the library to my project in TheIDE? Or somehow tell the linker where to find sndlib?
|
|
|
|
|
How to use third party libraries? (Newbie alert!)
By: Alatius on Sat, 06 May 2006 00:00
|
|
|
Re: How to use third party libraries? (Newbie alert!)
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: Alatius on Sat, 06 May 2006 21:08
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: ebojd on Tue, 30 January 2007 16:14
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: bonami on Thu, 28 June 2007 12:01
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: mirek on Thu, 28 June 2007 18:52
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: bonami on Fri, 29 June 2007 03:33
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: mirek on Fri, 29 June 2007 08:21
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: bonami on Fri, 29 June 2007 09:39
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: mirek on Fri, 29 June 2007 16:18
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: bonami on Mon, 02 July 2007 03:38
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: mirek on Mon, 02 July 2007 08:33
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: bonami on Mon, 02 July 2007 09:57
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: mirek on Mon, 02 July 2007 10:00
|
|
|
Re: How to use third party libraries? (Newbie alert!)
By: bonami on Mon, 02 July 2007 10:22
|
Goto Forum:
Current Time: Sun May 19 16:27:50 CEST 2024
Total time taken to generate the page: 0.00852 seconds
|