Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9223853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:10:24+00:00 2026-06-18T04:10:24+00:00

I am developing for OSX 10.8. I just installed libpcap via MacPorts and tried

  • 0

I am developing for OSX 10.8. I just installed libpcap via MacPorts and tried running a simple device hunter (below)

#include <stdio.h>
#include <pcap.h>

int main(int argc,char *argv[])
{
    char *dev, errbuf[PCAP_ERRBUF_SIZE];

    dev = pcap_lookupdev(errbuf);
    if(dev == NULL)
    {
        fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
        return(2);
    }

    printf("Device %s\n", dev);
    return(0);
}

and while trying to compile with g++ i am getting:

    Undefined symbols for architecture x86_64:
  "_pcap_lookupdev", referenced from:
      _main in ccIMp1m2.o

Any helpful advice so I can actually get started with learning this stuff would be great! I googled for a solid 10-15 minutes but just couldn’t find much on my particular issue with my setup.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:10:26+00:00Added an answer on June 18, 2026 at 4:10 am

    You need to link libpcap. Probably -lpcap added to your compiler command line will work. If it’s installed somewhere strange (and it might be, since you got it from MacPorts), you might need -L/path/to/libpcap -lpcap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just tried to write a simple C program on OSX Lion #include <stdio.h>
I've just purchased a new computer (mac OSX) and I want to continue developing
I'm developing a very simple cross platform window class in C++ just so I
I'm developing a desktop Mac OS X App that saves its very simple data
I am developing a unix console application on OS X. I just updated three
I've been developing iOs and OsX applications for several months now and it still
I've been programming for a while, but just recently decided to start developing for
Im developing a GWT application in Eclipse on OSX, using the built in Jetty
I am developing some Hid Managment classes on osx and after googling for quite
I've been developing a couple of NetBeans 7 modules on OSX with little problem.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.