Tôi đang cố gắng lắp ráp một số mã 32 bit bằng NASM và GCC trên hệ thống 64 bit. Tôi sử dụng hai lệnh sauKhông thể tìm thấy crtn.o, liên kết mã 32 bit trên hệ thống 64 bit
nasm -f elf32 -g -F stabs coc.asm
gcc -m32 -o coc coc.o
NASM dường như làm tốt, nhưng LD phàn nàn:
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status
Tôi đang chạy Ubuntu 11.10, và tôi đã kiểm tra và tôi khá chắc chắn libc được cài đặt.
trùng lặp có thể xảy ra [vấn đề Biên soạn: không thể tìm thấy crt1.o] (http://stackoverflow.com/questions/6329887/compiling-problems- cannot-find-crt1-o) – user2284570