[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-team] Prob de librairies....



Hello,


J'ai un petit problème avec une librairie:
J'avais commencé un travail en C et je linkais de maniere
statique la librairie libpcap.a avec l'aide de make, et
tout allait bien.  Maintenant je suis passé au C++, et j'ai
un message d'erreur:

c++ -O3 -mpentium -Wall -D_DEBUG_  libpcap-0.3/libpcap.a global.o interface.o host.o listener.o main.o -o test
listener.o: In function `listener::listener(void)':
listener.o(.text+0x2f): undefined reference to `pcap_open_live(char *, int, int, int, char *)'
collect2: ld returned 1 exit status
make: *** [all] Error 1


listener.cc (en partie) :

listener::listener () {

        char error_buffer[128];

        if ( (device_descr = pcap_open_live (ife->getName (),
              ife->getMtu (), 1, PKT_DELAY, error_buffer)) == NULL) {
                cerr << error_buffer << endl;
        }
....

listener.h (en partie):

#include <iostream.h>
#include <unistd.h>
#include "pcap.h"
#include "interface.h"
....


dans la directory ou se trouve les fichiers sources, j'ai `pcap.h'
, et une dir. libpcap-0.3/ contenant libpcap.a.  Je le fait comme
ca car c'était le seul moyen pour que ca marche lorsque je faisait
le programme en C.

le Makefile:

CXX=c++
CXXFLAGS=-O3 -mpentium -Wall -D_DEBUG_

all:    libpcap-0.3/libpcap.a \
        global.o \
        interface.o \
        host.o \
        listener.o \
        main.o

        $(CXX) $(CXXFLAGS) $^ -o test

clean:

        rm -f *.o



Heeeeeeeeeeeeeeeeeeeeeeeeeeellllp!!!
je peux plus rien faire si ca ne marche pas!
Je suis sur que c'est une connerie, mais je trouve pas de solution.
J'ai deja essayé en installant libpcap.a dans toutes les dirs. standart
(/usr/lib, /usr/local/lib) et en placant le fichier header en bonne 
place, mais rien à faire!

Merci 


Philippe Legrain

----- La messagerie itinérante sans abonnement NetCourrier -----
Web : www.netcourrier.com     Minitel : 3615 et 3623 NETCOURRIER
                  Tél : 08 36 69 00 21
---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.
Archive of the list: http://tania.be.linux.org/