[請問] libcurl疑問已回收
看板ask (問板)作者KTR150Fi (I will come back soon .)時間11年前 (2015/03/14 04:07)推噓0(0推 0噓 4→)留言4則, 1人參與討論串1/1
請問
在DevC++環境下
將lib和include設定好
Linker也加入-lcurl
然後無法編譯
信息出現 undefined reference to `_imp__curl_easy_init'
請問這種狀況如何解決?
感謝
以下測試程式碼:
/*Yahoo! 奇摩字典的資料傳送分析*/
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
int main(int argc, char *argv[])
{
char POST[255] = "" ;
CURL *curl;
CURLcode res;
curl = curl_easy_init();
sprintf(POST,"ei=UTF-8&p=%s",argv[1]);
curl_easy_setopt(curl, CURLOPT_URL, "tw.dictionary.yahoo.com/search");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, POST);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
return 0;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.244.152.39
※ 文章網址: https://www.ptt.cc/bbs/ask/M.1426277245.A.1E3.html
→
03/14 05:23, , 1F
03/14 05:23, 1F
→
03/14 05:24, , 2F
03/14 05:24, 2F
兩種方式出現這樣的問題
檔案\lib\libcurl.a(easy.o)
信息(.text+0x16): undefined reference to `WSAStartup@8'
、、 `WSACleanup@0'
、、 `libssh2_init'
、、 `libssh2_exit'
、、 `WSACleanup@0'
請問這問題出在哪裡?
※ 編輯: KTR150Fi (60.244.152.39), 03/14/2015 12:00:49
→
03/14 12:18, , 3F
03/14 12:18, 3F
→
03/14 12:18, , 4F
03/14 12:18, 4F
ask 近期熱門文章
PTT職涯區 即時熱門文章
9
12