Tag Archives: ubuntu makefile Cross-compilation error

[Solved] ubuntu makefile Cross-compilation error: file not recognized: file format not recognized

When compiling netkit-ftp on linux ubuntu an error is reported: file not recognized: file format not recognized

[root@ubuntu /arnold_test/20211219_ftpCrossCompile/netkit-ftp-0.17]24# make
(cd  ftp && make)
make[1]: Entering directory '/arnold_test/20211219_ftpCrossCompile/netkit-ftp-0.17/ftp'
arm-linux-gnueabihf-gcc -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  glob.c -c
arm-linux-gnueabihf-gcc -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  main.c -c
arm-linux-gnueabihf-gcc -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  ruserpass.c -c
arm-linux-gnueabihf-gcc  cmds.o cmdtab.o domacro.o ftp.o glob.o main.o ruserpass.o  -o ftp
cmds.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
Makefile:14: recipe for target 'ftp' failed
make[1]: *** [ftp] Error 1
make[1]: Leaving directory '/arnold_test/20211219_ftpCrossCompile/netkit-ftp-0.17/ftp'
Makefile:7: recipe for target 'ftp.build' failed
make: *** [ftp.build] Error 2

Solution: make clean

Or manually delete the files generated by the previous compilation