Linking to external Libraries

Israel Fdez Cabrera israel at
Tue Sep 16 21:37:53 BST 2003

May be you are familiar with the way linux use the shared libraries. you
may have one or both of the following, a shared object .so or an object
library, .la. 
Linux names libraries using the "lib" word + "library name" + ".so",
(asume the library is in a standard location, /lib/, /usr/lib, etc...)
Supouse U want to with pthread library, the library name is, ok, then Project Menu->Project Options (F7) -> Compiler
Options -> Linker Flags, Add this:


"-l" + "library name"

with no lib or

hope It help... best reg at rds 

On Tue, 2003-09-16 at 15:13, Friedrich Koester wrote:

> Hi there!
> I know that this is probably a newbie question; but I've been looking for a 
> solution for several hours now and can't find anything useful.
> I want to program in C using KDevelop 2.1.5 using KDE 3.1.1 under SuSE Linux 
> 8.2. I want to include an external library from Sourceforge (net-snmp). I 
> installed it GNU-like, and the .h-files reside in 
> /usr/local/include/net-snmp/ now. As a starting point I've tried to implement 
> an example program from a tutorial which can be found here:
> I've successfully compiled and run that program using the Makefile provided on 
> that page. But in KDevelop, I seem to have problems linking to the libraries 
> which are included in the beginning of the file:
> #include <net-snmp/net-snmp-config.h>
> #include <net-snmp/net-snmp-includes.h>
> The function calls referring to those libraries produce errors during 'make' 
> like these:
> main.o(.text+0x26): In function `main': 
> /home/[bla]/main.c:56: undefined reference to `init_snmp' 
> main.o(.text+0x38):/home/[bla]/main.c:61: undefined reference to 
> `snmp_sess_init' 
> main.o(.text+0x7f):/home/[bla]/main.c:75: undefined reference to `snmp_open' 
> main.o(.text+0x9e):/home/[bla]/main.c:79: undefined reference to `snmp_perror'
> and so on...
> I've tried including those libraries by choosing Project -> Options -> Linker 
> Options -> additional libraries. I'm not sure about the format in which I'd 
> have to enter the reference to the libraries, though, and couldn't find any 
> information on that either.
> My question is: where and in what format do I need to tell KDevelop about 
> those external libraries?
> Thank you for any help
> Friedrich
> -
> to unsubscribe from this list send an email to kdevelop-request at with the following body:
> unsubscribe »your-email-address«

Israel Fdez Cabrera
Usuario Linux: 270292    (
israel at
Segurmatica. Consultoría y Seguridad Informática
La Habana, Cuba.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the KDevelop mailing list