Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: NTop: Misc

Problem with compiling modified ver. of pfsend

 

 

NTop misc RSS feed   Index | Next | Previous | View Threaded


afridi_ahmad29 at yahoo

Aug 1, 2012, 10:10 AM

Post #1 of 9 (1163 views)
Permalink
Problem with compiling modified ver. of pfsend

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 [at] ahmed-Latitude-D62:~/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


c.d.wakelin at reading

Aug 1, 2012, 10:17 AM

Post #2 of 9 (1117 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

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 [at] ahmed-Latitude-D62:~/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
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>


--
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin, c.d.wakelin [at] reading
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
Ntop-misc [at] listgateway
http://listgateway.unipi.it/mailman/listinfo/ntop-misc


afridi_ahmad29 at yahoo

Aug 1, 2012, 10:52 AM

Post #3 of 9 (1120 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

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 <c.d.wakelin [at] reading>
To: ntop-misc [at] listgateway
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 [at] ahmed-Latitude-D62:~/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
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>


--
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin,                          c.d.wakelin [at] reading
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
Ntop-misc [at] listgateway
http://listgateway.unipi.it/mailman/listinfo/ntop-misc


c.d.wakelin at reading

Aug 1, 2012, 10:59 AM

Post #4 of 9 (1113 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

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 <c.d.wakelin [at] reading>
> To: ntop-misc [at] listgateway
> 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 [at] ahmed-Latitude-D62:~/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
>> Ntop-misc [at] listgateway
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
>
>
>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>


--
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin, c.d.wakelin [at] reading
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
Ntop-misc [at] listgateway
http://listgateway.unipi.it/mailman/listinfo/ntop-misc


afridi_ahmad29 at yahoo

Aug 2, 2012, 2:19 AM

Post #5 of 9 (1135 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

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 [at] ahmed-Latitude-D62:~/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 <c.d.wakelin [at] reading>
To: ntop-misc [at] listgateway
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 <c.d.wakelin [at] reading>
> To: ntop-misc [at] listgateway
> 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 [at] ahmed-Latitude-D62:~/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
>> Ntop-misc [at] listgateway
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
>
>
>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>


--
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin,                          c.d.wakelin [at] reading
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
Ntop-misc [at] listgateway
http://listgateway.unipi.it/mailman/listinfo/ntop-misc


deri at ntop

Aug 2, 2012, 2:21 AM

Post #6 of 9 (1119 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

Hi
do
gcc pfsend.c -o pfsend -l pfring -lpthreads

Luca
On Aug 2, 2012, at 11:19 AM, Khan <afridi_ahmad29 [at] yahoo> 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 [at] ahmed-Latitude-D62:~/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 <c.d.wakelin [at] reading>
> To: ntop-misc [at] listgateway
> 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 <c.d.wakelin [at] reading>
> > To: ntop-misc [at] listgateway
> > 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 [at] ahmed-Latitude-D62:~/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
> >> Ntop-misc [at] listgateway
> >> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
> >>
> >
> >
> >
> >
> > _______________________________________________
> > Ntop-misc mailing list
> > Ntop-misc [at] listgateway
> > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
> >
>
>
> --
> --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
> Christopher Wakelin, c.d.wakelin [at] reading
> 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
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc


afridi_ahmad29 at yahoo

Aug 2, 2012, 3:41 AM

Post #7 of 9 (1117 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

Hi Luca,

the number of errors are reduced.

ahmed [at] ahmed-Latitude-D62:~/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-

RgerdasKhan

________________________________
From: Luca Deri <deri [at] ntop>
To: ntop-misc [at] listgateway; Khan <afridi_ahmad29 [at] yahoo>
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 <afridi_ahmad29 [at] yahoo> 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 [at] ahmed-Latitude-D62:~/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 <c.d.wakelin [at] reading>
>To: ntop-misc [at] listgateway
>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 <c.d.wakelin [at] reading>
>> To: ntop-misc [at] listgateway
>> 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 [at] ahmed-Latitude-D62:~/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
>>> Ntop-misc [at] listgateway
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>>
>>
>>
>>
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc [at] listgateway
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
>
>
>--
>--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
>Christopher Wakelin,       
                  c.d.wakelin [at] reading
>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
>Ntop-misc [at] listgateway
>http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>
>
>_______________________________________________
>Ntop-misc mailing list
>Ntop-misc [at] listgateway
>http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>


cardigliano at ntop

Aug 2, 2012, 4:27 AM

Post #8 of 9 (1182 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

Please add -lpcap

Alfredo

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

> Hi Luca,
>
> the number of errors are reduced.
>
> ahmed [at] ahmed-Latitude-D62:~/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 <deri [at] ntop>
> To: ntop-misc [at] listgateway; Khan <afridi_ahmad29 [at] yahoo>
> 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 <afridi_ahmad29 [at] yahoo> 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 [at] ahmed-Latitude-D62:~/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 <c.d.wakelin [at] reading>
>> To: ntop-misc [at] listgateway
>> 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 <c.d.wakelin [at] reading>
>> > To: ntop-misc [at] listgateway
>> > 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 [at] ahmed-Latitude-D62:~/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
>> >> Ntop-misc [at] listgateway
>> >> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>> >>
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > Ntop-misc mailing list
>> > Ntop-misc [at] listgateway
>> > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>> >
>>
>>
>> --
>> --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
>> Christopher Wakelin, c.d.wakelin [at] reading
>> 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
>> Ntop-misc [at] listgateway
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc [at] listgateway
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>
>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc


afridi_ahmad29 at yahoo

Aug 2, 2012, 4:43 AM

Post #9 of 9 (1122 views)
Permalink
Re: Problem with compiling modified ver. of pfsend [In reply to]

hi

It worked, thank you very much. Now i can play with these examples.

 
Best regards
Khan


________________________________
From: Alfredo Cardigliano <cardigliano [at] ntop>
To: ntop-misc [at] listgateway; Khan <afridi_ahmad29 [at] yahoo>
Sent: Thursday, August 2, 2012 1:27 PM
Subject: Re: [Ntop-misc] Problem with compiling modified ver. of pfsend


Please add -lpcap

Alfredo


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

Hi Luca,
>
>
>the number of errors are reduced.
>
>
>ahmed [at] ahmed-Latitude-D62:~/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-
>
>
>RgerdasKhan
>
>________________________________
> From: Luca Deri <deri [at] ntop>
>To: ntop-misc [at] listgateway; Khan <afridi_ahmad29 [at] yahoo>
>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 <afridi_ahmad29 [at] yahoo> 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 [at] ahmed-Latitude-D62:~/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 <c.d.wakelin [at] reading>
>>To: ntop-misc [at] listgateway
>>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 <c.d.wakelin [at] reading>
>>> To: ntop-misc [at] listgateway
>>> 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 [at] ahmed-Latitude-D62:~/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
>>>> Ntop-misc [at] listgateway
>>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Ntop-misc mailing list
>>> Ntop-misc [at] listgateway
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>>
>>
>>
>>--
>>--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
>>Christopher Wakelin,       
                  c.d.wakelin [at] reading
>>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
>>Ntop-misc [at] listgateway
>>http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
>>
>>_______________________________________________
>>Ntop-misc mailing list
>>Ntop-misc [at] listgateway
>>http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
>
>
>_______________________________________________
>Ntop-misc mailing list
>Ntop-misc [at] listgateway
>http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>

NTop misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.