Please add -lpcap

Alfredo

On Aug 2, 2012, at 12:41 PM, Khan <[email protected]> wrote:

> Hi Luca,
> 
> the number of errors are reduced.
> 
> ahmed@ahmed-Latitude-D620:~/PF_RING/userland/examples$ gcc pfsend.c -o pfsend 
> -l pfring -lpthread
> /tmp/cciYWeM6.o: In function `main':
> pfsend.c:(.text+0xf25): undefined reference to `pcap_open_offline'
> pfsend.c:(.text+0xf93): undefined reference to `pcap_next_ex'
> pfsend.c:(.text+0x125e): undefined reference to `pcap_close'
> /usr/local/lib/libpfring.so: undefined reference to `pcap_compile_nopcap'
> collect2: ld returned 1 exit status
> 
> what else do i need to check-
> 
> Rgerdas
> Khan
> From: Luca Deri <[email protected]>
> To: [email protected]; Khan <[email protected]> 
> Sent: Thursday, August 2, 2012 11:21 AM
> Subject: Re: [Ntop-misc] Problem with compiling modified ver. of pfsend
> 
> Hi
> do
>  gcc pfsend.c -o pfsend -l pfring -lpthreads
> 
> Luca
> On Aug 2, 2012, at 11:19 AM, Khan <[email protected]> wrote:
> 
>> Hi again,
>> 
>> seems like the Makefile is upto date, and after making those changes, i got 
>> a new error,
>> as a matter of fact, i cannot run any '.c' file in the examples directory 
>> with gcc.
>> I tried to compile pfsend.c and here is the list of errors that i got;
>> 
>> ahmed@ahmed-Latitude-D620:~/PF_RING/userland/examples$ gcc pfsend.c -o pfsend
>> /tmp/ccfOt4oo.o: In function `print_stats':
>> pfsend.c:(.text+0x2ba): undefined reference to `pfring_format_numbers'
>> pfsend.c:(.text+0x2e8): undefined reference to `pfring_format_numbers'
>> pfsend.c:(.text+0x312): undefined reference to `pfring_format_numbers'
>> pfsend.c:(.text+0x33c): undefined reference to `pfring_format_numbers'
>> pfsend.c:(.text+0x366): undefined reference to `pfring_format_numbers'
>> /tmp/ccfOt4oo.o: In function `sigproc':
>> pfsend.c:(.text+0x4a9): undefined reference to `pfring_close'
>> /tmp/ccfOt4oo.o: In function `bind2core':
>> pfsend.c:(.text+0x617): undefined reference to `pthread_setaffinity_np'
>> /tmp/ccfOt4oo.o: In function `main':
>> pfsend.c:(.text+0xcc0): undefined reference to `pfring_open'
>> pfsend.c:(.text+0xd17): undefined reference to `pfring_set_application_name'
>> pfsend.c:(.text+0xd2f): undefined reference to `pfring_version'
>> pfsend.c:(.text+0xdd2): undefined reference to `pfring_set_tx_watermark'
>> pfsend.c:(.text+0xf25): undefined reference to `pcap_open_offline'
>> pfsend.c:(.text+0xf93): undefined reference to `pcap_next_ex'
>> pfsend.c:(.text+0x125e): undefined reference to `pcap_close'
>> pfsend.c:(.text+0x12dd): undefined reference to `pfring_close'
>> pfsend.c:(.text+0x15a8): undefined reference to `pfring_config'
>> pfsend.c:(.text+0x1611): undefined reference to `pfring_set_socket_mode'
>> pfsend.c:(.text+0x161e): undefined reference to `pfring_enable_ring'
>> pfsend.c:(.text+0x163b): undefined reference to `pfring_close'
>> pfsend.c:(.text+0x16ee): undefined reference to 
>> `pfring_copy_tx_packet_into_slot'
>> pfsend.c:(.text+0x1800): undefined reference to `pfring_send_ifindex'
>> pfsend.c:(.text+0x1850): undefined reference to `pfring_send'
>> pfsend.c:(.text+0x1899): undefined reference to `pfring_send'
>> pfsend.c:(.text+0x1af7): undefined reference to `pfring_close'
>> collect2: ld returned 1 exit status
>> 
>> seems to me like a library is messing from a directory or do i need to use 
>> gcc in a different way, any help would be appreciated!
>> 
>> this might be very basic steps, but i am new so i have to figure out a way.
>> 
>> Regards
>> Khan
>> From: Chris Wakelin <[email protected]>
>> To: [email protected] 
>> Sent: Wednesday, August 1, 2012 7:59 PM
>> Subject: Re: [Ntop-misc] Problem with compiling modified ver. of pfsend
>> 
>> You'll need to add ahmed_pfsend to the "PFPROGS" list or run "make
>> ahmed_pfsend".
>> 
>> Best Wishes,
>> Chris
>> 
>> On 01/08/12 18:52, Khan wrote:
>> > Hi again and thanks for a response,
>> > 
>> > I just wanted to test, so i only changed the src and dest, ip addresses at 
>> > this point.
>> > 
>> > I did made the necessary changes in the Makefile but did not create a new 
>> > one.
>> > I added this line into the Makefile;
>> > 
>> > ahmed_pfsend: ahmed_pfsend.o ${LIBPFRING}
>> > ${CC} ${CFLAGS} ahmed_pfsend.o ${LIBPCAP} ${LIBS} -o $@
>> > and then
>> > 
>> > nano Makefile
>> > ls
>> > make
>> > 
>> >  BR
>> > Khan
>> > 
>> > ________________________________
>> >  From: Chris Wakelin <[email protected]>
>> > To: [email protected] 
>> > Sent: Wednesday, August 1, 2012 7:17 PM
>> > Subject: Re: [Ntop-misc] Problem with compiling modified ver. of pfsend
>> >  
>> > It would probably help if you told us what you changed!
>> > 
>> > This looks like an error in your additions to me. You may also need to
>> > include some libs on the command line (look at the Makefile).
>> > 
>> > For my versions I made a Makefile.cdw and just copied the relevant
>> > entries to make my own, then ran "make -f Makefile.cdw".
>> > 
>> > Best Wishes,
>> > Chris
>> > 
>> > On 01/08/12 18:10, Khan wrote:
>> >> Hello, 
>> >>
>> >> I used pfsend to TX packets via PF_RING and it went well. Now i have 
>> >> modified the pfsend.c version to
>> >> ahmed_pfsend.c, but the problem is I cannot compile it with gcc. I copied 
>> >> pfsend.c to ahmed_pfsend.c as;
>> >>
>> >> cp pfsend.c ahmed_pfsend.c
>> >> there is no error in the program and i am certain.
>> >>
>> >>
>> >> i get the following error:
>> >>
>> >> ahmed@ahmed-Latitude-D620:~/PF_RING/userland/examples$ gcc -o 
>> >> ahmed_pfsend.c ahmed_pfsend
>> >> ahmed_pfsend: In function `_fini':
>> >> (.fini+0x0): multiple definition of `_fini'
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crti.o:(.fini+0x0):
>> >>  first defined here
>> >> ahmed_pfsend: In function `__data_start':
>> >> (.data+0x0): multiple definition of `__data_start'
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o:(.data+0x0):
>> >>  first defined here
>> >> ahmed_pfsend:(.rodata+0x4): multiple definition of `_IO_stdin_used'
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o:(.rodata.cst4+0x0):
>> >>  first defined here
>> >> ahmed_pfsend: In function `_start':
>> >> (.text+0x1108): multiple definition of `_start'
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o:(.text+0x0):
>> >>  first defined here
>> >> ahmed_pfsend:(.rodata+0x0): multiple definition of `_fp_hw'
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o:(.rodata+0x0):
>> >>  first defined here
>> >> ahmed_pfsend: In function `_init':
>> >> (.init+0x0): multiple definition of `_init'
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crti.o:(.init+0x0):
>> >>  first defined here
>> >> /usr/lib/gcc/i686-linux-gnu/4.6/crtend.o:(.dtors+0x0): multiple 
>> >> definition of `__DTOR_END__'
>> >> ahmed_pfsend:(.dtors+0x4): first defined here
>> >> /usr/bin/ld: error in ahmed_pfsend(.eh_frame); no .eh_frame_hdr table 
>> >> will be created.
>> >> collect2: ld returned 1 exit status
>> >>
>> >>
>> >>  can anyone help me out here//
>> >>
>> >>
>> >> cheers
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> Ntop-misc mailing list
>> >> [email protected]
>> >> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>> >>
>> > 
>> > 
>> > 
>> > 
>> > _______________________________________________
>> > Ntop-misc mailing list
>> > [email protected]
>> > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>> > 
>> 
>> 
>> -- 
>> --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
>> Christopher Wakelin,                          [email protected]
>> IT Services Centre, The University of Reading,  Tel: +44 (0)118 378 2908
>> Whiteknights, Reading, RG6 6AF, UK              Fax: +44 (0)118 975 3094
>> _______________________________________________
>> Ntop-misc mailing list
>> [email protected]
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>> 
>> 
>> _______________________________________________
>> Ntop-misc mailing list
>> [email protected]
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
> 
> 
> 
> _______________________________________________
> Ntop-misc mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc

_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to