LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-23-2011, 07:32 PM   #1
miker00lz
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Rep: Reputation: 0
problem compiling my C program using libpcap on linux, works on windows.


hi, i'm writing a portable x86 PC emulator in C. been working on it for about 7 or 8 months, and i've just added ethernet emulation using libpcap/winpcap.

on windows using MinGW (i use the Dev-C++ IDE in win) it works perfectly, but when i try to compile it on a linux box (Debian 6.0 "Squeeze") i get some errors. i've got libpcap and libpcap-dev installed. here is what happens when i try to compile, including the gcc command line i'm using:

Code:
mike@pentium4:~/mysrc/fake86# gcc adlib.c flags.c main.c ops.c ports.c video.c cpu.c grpops.c network.c packet.c render.c disk.c keyboard.c oplist.c parsecl.c speaker.c -o ./fake86-linux $(sdl-config --cflags --libs) $(pcap-config --cflags --libs)
packet.c: In function initpcap:
packet.c:44: error: PCAP_SRC_IF_STRING undeclared (first use in this function)
packet.c:44: error: (Each undeclared identifier is reported only once
packet.c:44: error: for each function it appears in.)
packet.c:92: error: PCAP_OPENFLAG_PROMISCUOUS undeclared (first use in this function)
i've googled quite a bit and can't find any pages that have been able to help, and there's nothing relevant in the pcap docs either.

any ideas? thanks...

Last edited by miker00lz; 06-23-2011 at 07:38 PM.
 
Old 06-23-2011, 08:40 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Seems like an obvious question if you have been working on this for so long, but on a quick search I found this
reference and wondered if remote-ext.h is in the appropriate place to define the errored item (PCAP_SRC_IF_STRING)?

Same for any other errors, in that are all the appropriate headers available.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cannot find ldag when compiling libpcap under freebsd7.1 Hosferatu *BSD 4 04-06-2011 04:43 PM
Compiling libpcap files Mridulj Linux - Software 10 04-12-2009 03:24 PM
Error compiling a program using libpcap uma mahesh Linux - Networking 14 03-06-2009 03:43 AM
simple mail program works on windows and not on linux naijaguy Linux - General 1 04-21-2005 08:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration