Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Alatius is currently offline  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?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message icon11.gif
Read Message
Read Message
Previous Topic: How can I attach Layouts to LabelBox as a TabMenu replacement?
Next Topic: UVS2 usage
Goto Forum:
  


Current Time: Sat Apr 27 14:00:26 CEST 2024

Total time taken to generate the page: 0.04732 seconds