[Coral-dev] Linker error with coral_read_pkt()

Siva Ramagopal ramagopa at etek.chalmers.se
Thu Jul 7 03:07:35 PDT 2005


Hi all,

I'm including libcoral.h in two different C++ files. Compiling them
separately into their respective object files gives no problems.
However, when I link together the two object files, I get an error
complaining about the multiple inclusion of coral_read_pkt().

Error:
$:~/testarea> g++ -I ~/bin/Coral/include -g -Wall coraltest.cc dummy.cc
-L ~/bin/Coral/lib -L ~/lib/lib -lcoral -lpcap -lz
/tmp/ccwlqoSc.o(.bss+0x0): In function `dummy_func()':
/home/user1/testarea/dummy.cc:3: multiple definition of `coral_read_pkt'

/tmp/cccvetVD.o(.bss+0x0):/home/user1/testarea/coraltest.cc:10: first
defined here
collect2: ld returned 1 exit status

coraltest.cc is a simple program to count the number of packets in a
tracefile. dummy.cc just includes unistd.h, sys/param.h and libcoral.h.

I'm using gcc 3.3.3 on AMD64/SuSE Linux 9.1.

I could be missing something obvious here, but after several hours of
racking my brains, I gave up :(
I'd greatly appreciate any help here,
TIA,
-Shiva



More information about the Coral-dev mailing list