简体   繁体   中英

cross compiling + cygwin + raspberry pi

I am following this tutorial: http://www.a2p.it/wordpress/tech-stuff/development/remote-debugging-raspberrypi/

to attempt to cross-compile some c++ code, but getting the following error:

19:36:00 **** Incremental Build of configuration Debug for project test ****
make all 
Building file: ../src/test.cpp
Invoking: Cygwin C++ Compiler
arm-unknown-linux-gnueabi-g++ -IC:\Dev\cygwin64\opt\cross\x-tools\arm-unknown-linux-gnueabi\arm-unknown-linux-gnueabi\sysroot\usr\include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o "src/test.o" "../src/test.cpp"
src/subdir.mk:18: recipe for target 'src/test.o' failed
make: *** [src/test.o] Error 127

19:36:01 Build Finished (took 120ms)

I am using 64-bit cygwin, 64-bit Eclipse and gnueabi-hardfp found here: https://github.com/IanLinsdell/Raspberrypi

Does anyone know what this error means?

UPDATE: using 32-bit cygwin i was able to get past the above error, but now i'm getting these linker errors:

Building target: libtest
Invoking: Cross G++ Linker
arm-unknown-linux-gnueabi-g++ -L"C:\Dev\cygwin\opt\cross\x-tools\sysroot\usr\lib" -shared -o "libtest"  ./src/test.o   
/opt/cross/x-tools/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory
/opt/cross/x-tools/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find -lstdc++
/opt/cross/x-tools/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find -lgcc_s
/opt/cross/x-tools/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
/opt/cross/x-tools/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find /usr/lib/libc_nonshared.a
/opt/cross/x-tools/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find /lib/ld-linux.so.3
collect2: ld returned 1 exit status
makefile:45: recipe for target 'libtest' failed
make: *** [libtest] Error 1

I see all the files above in the directory C:\\Dev\\cygwin\\opt\\cross\\x-tools\\sysroot\\usr\\lib. I've added that path in the G++ Linker Lib path setting and i've even added it to the Cross Compiler PATH. what gives?

Cygwin usually maps your local drive with /cygdrive/c/ instead of c:\\ so this will probably help your -L directive which specifies the library search path

Also Unix systems use forward slashes / instead so your compile line should look like this : arm-unknown-linux-gnueabi-g++ -L"/cygdrive/c/Dev/cygwin\\opt/cross/x-tools/sysroot/usr/lib" -shared -o "libtest" ./src/test.o

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM