Linking to external Libraries

Friedrich Koester friedrich28 at gmx.de
Tue Sep 16 19:13:43 UTC 2003


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:
http://www.net-snmp.org/tutorial-5/toolkit/demoapp/index.html

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 kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list