`bash: ./a.out: No such file or directory` on running executable produced by `ld`

后端 未结 3 1664
温柔的废话
温柔的废话 2020-12-15 23:57

Here is a Hello World code in C:

// a.c
#include 

int main() {
    printf(\"Hello world\\n\");
    return 0;
}

I compile it

3条回答
  •  时光说笑
    2020-12-16 00:39

    Use that:

      ld -o a.out -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o -lc c.o /usr/lib/crtn.o
    

提交回复
热议问题