[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libnet and c++ link problem
On Mon, Jun 03, 2002 at 06:29:36AM -0700, Dan Shechter wrote:
> Hello all,
>
> I hope it's the right place to ask.
> I searched the mailing lists and google but found no answer.
> System : openbsd 3.1 i386. libnet is installed from the 3.1 packages.
> I have libnet linkage problem: when I compile and link "c" program
> then all is _OK_.
> But, when I change the name of prog.c to prog.cpp (or prog.cc) all
> the libnet function are unresolved at the linkage stage. I also use
> pcap in the program and no problem there.
> I hadn't changed nothing with the Makefile. I tried this using g++
> and gcc.
>
> Can you help me?
>
Check any half-decent C++ book.
You just need to add
extern "C" {
}
blocks around the libnet include.