答案1
您遇到了错误-lgd
。您是否安装了 libgd-dev?
guest@desktop /tmp $ cat helloworld.c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, world!\n");
return 0;
}
guest@desktop /tmp $ gcc -o helloworld helloworld.c -lgd
/usr/bin/ld : ne peut trouver -lgd
collect2: error: ld returned 1 exit status
guest@desktop /tmp $ sudo aptitude install libgd-dev
guest@desktop /tmp $ gcc -o helloworld helloworld.c -lgd
guest@desktop /tmp $ ./helloworld
Hello, world!