Ich habe Fehler auf meinem Makefile-Code bekommen und ich habe keine Ahnung, wie es zu beheben, ich suchte die Website nach einer Antwort und endete damit, ein Konto zu erstellen um Hilfe zu fragen Hier ist der Fehlercodemehrere Definition von '_start'
date.o: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o:(.text+0x0): first defined here
date.o: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o (.fini+0x0): first defined here
date.o:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o (.rodata.cst4+0x0): first defined here
date.o: In function `data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
date.o: In function `data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o:(.data+0x0): first defined here
date.o: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o (.init+0x0): first defined here
/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
date.o:(.data+0x10): first defined here
/usr/bin/ld: error in date.o(.eh_frame); no .eh_frame_hdr table will be created.
collect2: error: ld returned 1 exit status
Makefile:3: recipe for target 'testdate' failed
make: *** [testdate] Error 1
und mein Make-Datei
testdate: date.o testdate.o
g++ -Wall -o testdate.o date.o
date.o: date.h date.cpp
g++ -Wall -c date.cpp
testdate.o: date.h testdate.cpp
g++ -Wall -c testdate.cpp
Es scheint so nicht zu Ihrem C++ Code zu makefile aber zusammenhängt, zu mir. – mertyildiran
Der Befehl in Ihrer ersten Regel sieht falsch aus. Das Wort nach '-o' sollte der Name der Datei sein, die g ++ erstellen soll. – Beta