I have already created the amhello-1.0.tar.gz using this tutorial click to open
now am trying to make cross compiling but error occurs. i am following this tutorial click to open
after entering make
command error occurs
hp@ubuntu:~/amhello-1.0$ make
make all-recursive
make[1]: Entering directory `/home/hp/amhello-1.0'
Making all in src
make[2]: Entering directory `/home/hp/amhello-1.0/src'
i586-mingw32msvc-gcc -g -O2 -o hello.exe main.o
main.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make[2]: *** [hello.exe] Error 1
make[2]: Leaving directory `/home/hp/amhello-1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/hp/amhello-1.0'
make: *** [all] Error 2
It looks like you are re-using the same build directory for the cross-compile that you used for the original native build. The 'make' program doesn't know that you've changed toolchains, and doesn't consider the object file (main.o) to be out of date - so it doesn't try to recompile it, it just jumps straight to the link step - which fails because it's trying to link a native ELF object with foreign (mingw) libraries.
Try executing a
make clean
orrm src/*.o
before themake
to force full recompilation.