• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

tftpd geht nicht zum compilieren

tomycat

Member
hallo,
ich möchte gerne den tftpd compilieren und einen suse 10.3 system.
den Quellcode habe ich mal hochkopiert, weil es so lang ist.

http://www.feledi.de/opentftpd.cpp.txt

warum haut das nicht hin...
Code:
linux-953k:~/opentftp # cc opentftpd -o tftpd
opentftpd:(.rodata+0x0): multiple definition of `_fp_hw'  <--------welche Zeile macht Probleme ?
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crt1.o:(.rodata+0x0): first defined
here
opentftpd: In function `__data_start':
(.data+0x4): multiple definition of `__dso_handle'
/usr/lib/gcc/i586-suse-linux/4.2.1/crtbegin.o:(.data+0x0): first defined here
opentftpd: In function `_init':
/glibc-tmp-50bc3e52fdee1ae191368f2f492c285b/glibc-2.3.6/build-glibc-2.3.6/csu/cr
ti.S:34: multiple definition of `_init'
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crti.o:/usr/src/packages/BUILD/glibc
-2.6.1/cc-nptl/csu/crti.S:15: first defined here
opentftpd: In function `_start':
/glibc-tmp-50bc3e52fdee1ae191368f2f492c285b/glibc-2.3.6/csu/../sysdeps/i386/elf/
start.S:65: multiple definition of `_start'
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crt1.o:(.text+0x0): first defined he                              re
opentftpd: In function `_fini':
/glibc-tmp-50bc3e52fdee1ae191368f2f492c285b/glibc-2.3.6/build-glibc-2.3.6/csu/cr                              ti.S:50: multiple definition of `_fini'
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crti.o:/usr/src/packages/BUILD/glibc                              -2.6.1/cc-nptl/csu/crti.S:41: first defined here
opentftpd:(.got.plt+0x0): multiple definition of `_GLOBAL_OFFSET_TABLE_'
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crt1.o:(.got.plt+0x0): first defined                               here
opentftpd:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crt1.o:(.rodata.cst4+0x0): first def                              ined here
opentftpd: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../crt1.o:(.data+0x0): first defined he                              re
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../../i586-suse-linux/bin/ld: warning:                               Cannot create .eh_frame_hdr section, --eh-frame-hdr ignored.
/usr/lib/gcc/i586-suse-linux/4.2.1/../../../../i586-suse-linux/bin/ld: error in                               opentftpd(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status
linux-953k:~/opentftp #

mein Ziel ist es, den Quelltext zuverstehen ( so wer ist es auch nicht ) und zuverändern.
Makefile habe ich nicht.

was muss ich statt cc opentftpd -o tftpd schreiben dass ich Zeile für Zeile compilieren kann.
mfg tom
 

spoensche

Moderator
Teammitglied
Kein Makefile kann nicht sein. Um CPP zu compilieren musst du den g++ verwenden und nicht den gcc.
 
OP
T

tomycat

Member
Code:
linux-953k:~/opentftp # ls
LICENSE  README  opentftpd  opentftpd.cpp  opentftpd.h  opentftpd.ini  rc.opentftp
linux-953k:~/opentftp # ./configure
bash: ./configure: No such file or directory
linux-953k:~/opentftp # make
make: *** No targets specified and no makefile found.  Stop.
linux-953k:~/opentftp # c++ opentftpd.cpp -o tftpd
opentftpd.cpp: In function ‘void init()’:
opentftpd.cpp:1567: warning: deprecated conversion from string constant to ‘char*’
opentftpd.cpp:1615: warning: deprecated conversion from string constant to ‘char*’
opentftpd.cpp:1652: warning: deprecated conversion from string constant to ‘char*’
opentftpd.cpp:1733: warning: deprecated conversion from string constant to ‘char*’
opentftpd.cpp:1856: warning: deprecated conversion from string constant to ‘char*’
/tmp/cc7ANUho.o: In function `init()':
opentftpd.cpp:(.text+0x2526): undefined reference to `pthread_create'
/tmp/cc7ANUho.o: In function `main':
opentftpd.cpp:(.text+0x63b6): undefined reference to `pthread_create'
opentftpd.cpp:(.text+0x66ff): undefined reference to `pthread_create'
collect2: ld returned 1 exit status
linux-953k:~/opentftp #

mit c++ habe ich mehr Erfolg wie cc :)
für `pthread_create' habe ich den header, aber warum ist es undefiniert?
PS den Quellcode habe ich auf meiner HP.
kann mir jemand einen Tip geben?
brauche ich unbedingt `pthread_create' , weil dann klammere ich den Käse aus.
Ich will nur dass ich mich mit ftp test test einloggen kann. :)
 

Tooltime

Advanced Hacker
tomycat schrieb:
Ich will nur dass ich mich mit ftp test test einloggen kann.
Wie was einloggen? tftp ist ein Protokoll zum Booten von Diskless Clients und kein ftp-Server. Und mal nebenbei, Quellcode mit dem Datum 2005 dürfte für den Kernel 2.4 und der entsprechenden glibc gedacht sein. Was immer du da vor hast, warum nimmst du nicht eine aktuelle Software als Basis?
 

spoensche

Moderator
Teammitglied
Tooltime schrieb:
tomycat schrieb:
Ich will nur dass ich mich mit ftp test test einloggen kann.
Wie was einloggen? tftp ist ein Protokoll zum Booten von Diskless Clients und kein ftp-Server. Und mal nebenbei, Quellcode mit dem Datum 2005 dürfte für den Kernel 2.4 und der entsprechenden glibc gedacht sein. Was immer du da vor hast, warum nimmst du nicht eine aktuelle Software als Basis?

Dem kann ich mich nur anschließen.
 
Oben