Forum: PC-Programmierung Eclipse und libpcap


von Peter R. (Gast)


Lesenswert?

Hallo!

Irgendwie schein der einzige auf der Welt zu sein mit diesem Problem. 
Auf jeden Fall habe ich nirgends eine Lösung zu meinem Problem gefunden. 
Oder es ist so einfah zu lösen, dass es niemand dokumentiert.
Ich möchte die libpcap-Funktionen mit Eclipse verwenden, schaffe es aber 
nicht, das ganze zum Laufen zu bringen. Ich versuche ein 
Beispielprogramm, welches mit Winpcap mitgeliefert wurde in Eclipse zu 
kompilieren. Da findet er aber gewisse Abhängigkeiten nicht...
Bei einem Kollegen der Visual Studio hat ging das kompilieren auf 
anhieb, ich habe aber VS nicht. So muss ich mich mit Eclipse gebnügen. 
Unter Eclipse konnte ich auch bereits Beispielprogramme kompilieren, 
also sollte wenigstens bei der Installation der Programme alles glatt 
gelaufen sein. Laut dokumentation muss ich um die Library verwenden zu 
können folgendes tun:



To create an application that uses wpcap.dll with Microsoft Visual C++, 
follow the next steps:

    * Include the file pcap.h at the beginning of every source file that 
uses the functions exported by library.
    * If your program uses Win32 specific functions of WinPcap, remember 
to include WPCAP among the preprocessor definitions.
    * Set the options of the linker to include the wpcap.lib library 
file. wpcap.lib is generated compiling the WinPcap source code and can 
be found in the WinPcap developer's pack.
    * Set the options of the linker to include the winsock library file 
(for example wsock32.lib). This file is distributed with the C compiler 
and contains the socket functions for Windows. It is needed by some 
libpcap functions.

Remember that:

    * To add a preprocessor definition, you must select Settings from 
the Project menu, then select C/C++ from the tab control, and under the 
category General, you must add the definition under the Preprocessor 
Definitions text box.
    * To add a new library to the project with Microsoft Visual C++, you 
must select Settings from the Project menu, then select Link from the 
tab control, and then add the name of the new library in the 
Objcet/library modules editbox.
    * To add a new path where Microsoft Visual C++ will look for the 
libraries, you must select Options from the Tools menu, then Link from 
the tab control, library files from the show directories for combobox, 
and the add the path in the directories box.
    * To add a new path where Microsoft Visual C++ will look for include 
files, you must select Options from the Tools menu, then Link from the 
tab control, include files from the show directories for combobox, and 
the add the path in the directories box.



Nur schaffe ich das nicht in Eclipse. Kann mir da jemand helfen? Es gibt 
auh ein virtuelles Bier als Belohnung ;-)

von Peter R. (Gast)


Lesenswert?

Nachtrag, die ersten zwei Punkte sind kein Problem: ich beutze keine 
Windowsspezifischen Funktionen und ein #include "pcap.h" schaffe ich 
auch noch hinzuschreiben...
Aber dann beginnts schwierig zu werden!

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.