use libcurlto write some test code. when trying to compile, it refers to an undefined link. already use the -lcurlor option -Lto compile.
root@ubuntu:~/work/test/curlTest
-L/usr/lib/x86_64-linux-gnu -lcurl
root@ubuntu:~/work/test/curlTest
/tmp/ccnFnpaW.o: In function `main':
curl.c:(.text+0xb1): undefined reference to `curl_global_init'
curl.c:(.text+0xbc): undefined reference to `curl_easy_init'
curl.c:(.text+0x109): undefined reference to `curl_easy_setopt'
curl.c:(.text+0x136): undefined reference to `curl_easy_setopt'
curl.c:(.text+0x145): undefined reference to `curl_easy_perform'
collect2: error: ld returned 1 exit status
source
share