mmxcq@mmxcq-laptop:~/c/curl$ gcc -o q q.c
/tmp/ccyOh5HP.o: In function `main':
q.c:(.text+0x103): undefined reference to `curl_easy_init'
q.c:(.text+0x148): undefined reference to `curl_easy_setopt'
q.c:(.text+0x16c): undefined reference to `curl_easy_setopt'
q.c:(.text+0x190): undefined reference to `curl_easy_setopt'
q.c:(.text+0x19c): undefined reference to `curl_easy_perform'
q.c:(.text+0x1dc): undefined reference to `curl_easy_cleanup'
collect2: ld returned 1 exit status
gcc libcurl的时候出现这个 原来是没加curl路径
gcc -l curl -o q q.c 就可以了
/tmp/ccyOh5HP.o: In function `main':
q.c:(.text+0x103): undefined reference to `curl_easy_init'
q.c:(.text+0x148): undefined reference to `curl_easy_setopt'
q.c:(.text+0x16c): undefined reference to `curl_easy_setopt'
q.c:(.text+0x190): undefined reference to `curl_easy_setopt'
q.c:(.text+0x19c): undefined reference to `curl_easy_perform'
q.c:(.text+0x1dc): undefined reference to `curl_easy_cleanup'
collect2: ld returned 1 exit status
gcc libcurl的时候出现这个 原来是没加curl路径
gcc -l curl -o q q.c 就可以了