 |
 |
Undefined Symbols?
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
I'm porting a Windows app to Mac, and it uses winpcap. I found that libpcap is a decent equivalent, and downloaded it. I did ./configure, make, and make install with no problem. 'man pcap' informs me that I need to #include <pcap.h>. I did that (and pcap.h IS in /usr/include), and used 2 different short pieces of sample code online to test it. I try to compile it, and I get a linking error about some undefined symbols. This image explains it all.
I asked another Mac developer I know, and he said I might need a pcap.o file in my project, which would normally be in /usr/lib (but it's not). The only pcap.o file that I found was in the directory I built libpcap in. Adding it to the project adds even more complaining about undefined symbols. I took pcap.o out of my project. What's up with it?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
That means you aren't linking libpcap into your program. Add the library to your project and you should be good to go.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
Yeah, that's exacty what I want to do... How?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by macgyvr64:
Yeah, that's exacty what I want to do... How?
add -L/usr/lib -lpcap in on your compile line.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
When I do that, it can't find pcap.o. I think it should be in /usr/lib, but isn't...maybe I'll remake it.. hmmm. Any ideas?
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2001
Status:
Offline
|
|
It probably put it in /usr/local/lib.
Wade
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
hmmm...The only things in my /usr/local/lib are:
libexpat.0.4.0.dylib
libexpat.dylib
php
libexpat.0.dylib
libexpat.la
php.ini-copy
libexpat.a
libpcap.a
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by macgyvr64:
hmmm...The only things in my /usr/local/lib are:
libexpat.0.4.0.dylib
libexpat.dylib
php
libexpat.0.dylib
libexpat.la
php.ini-copy
libexpat.a
libpcap.a
There it is, right at the bottom. You need to link to that.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|