`bash: ./a.out: No such file or directory` on running executable produced by `ld`
问题 Here is a Hello World code in C: // a.c #include <stdio.h> int main() { printf("Hello world\n"); return 0; } I compile it as gcc a.c , which produces a.out as expected and ./a.out prints Hello world ... as expected. Now if I do the compile and link separately: gcc -c a.c; ld -lc a.o , it run the a.out produced as ./a.out I get the message: bash: ./a.out: No such file or directory I Googled that error and it seems that happens when the executable produced is a 32-bit ELF and the machine