Re: Fehler beim Einbinden von pcap.h und mysql.h - "undefined reference to ..." trotz Angabe der entsprechenden Headerfiles

Andreas Winkelmann <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Am Montag, 20. September 2004 16:04 schrieb Udo Gerhards:

> > > ich versuch gerade ein C++ Projekt mit KDevelop aufzusetzen, daß unter
> > > anderem die pcap.h und die mysql.h mit einbinden soll. Leider bekomme
> > > ich beim Compilieren immer Fehlermeldungen mit dem Inhalt
> > >
> > > "Undefined reference to ..."
> > >
> > > *g++ -o nwarp nwarp.o nw_standarts.o nw_database.o nw_device.o
> > > nw_dev_storage.o -L/usr/lib/ -L/usr/lib/qt3/lib/ -L/usr/X11R6/lib/
> > > -lqt-mt -lXext -lX11 -lm -lpthread
> > > *nwarp.o(.text+0x60): In function `main':
> > > *: undefined reference to `pcap_findalldevs'
> > > *nwarp.o(.text+0x145): In function `main':
> > > *: undefined reference to `pcap_lookupnet'
> > > *nw_database.o(.text+0xaf): In function
> > > `nw_database::nw_database[not-in-charge]()':
> > > *: undefined reference to `mysql_init'
> > > *nw_database.o(.text+0x195): In function
> > > `nw_database::nw_database[not-in-charge]()':
> > > *: undefined reference to `mysql_real_connect'
> > > *nw_database.o(.text+0x1aa): In function
> > > `nw_database::nw_database[not-in-charge]()':
> > > *: undefined reference to `mysql_errno'
> > > ...
> >
> > Der Linker findet die Libs nicht, bei mysql dürfte es -lmysqlclient sein,
> > bei pcap -lpcap ?
>
> O.K., aber wo setz ich die Schalter, damit Kdevelop die entsprechenden
> Pfade inkludiert? Ich habe mir mal die Projektoptions vorgenommen und
> leider nichts gefunden, wo ich dem Linker mitteilen soll, welche Pfade
> eingebunden werden sollen.

Pfade mit "-L/pfad/zum/verzeichnis".
Libs mit "-llibname_ohne_lib"

Für Mysql z.B.: "-L/usr/lib/mysql -lmysqlclient"

Bei den LinkerFlags (LDFLAGS).

-- 
	Andreas

-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfügbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.