Ld.exe cannot find -lcurl

(I noticed a question like this, but he was 2 years old.)

I am developing a Windows Form application in Visual C ++ 2008 that uses the FTP function libCurl. Although I added the lib and include directories in the include and library search paths, added libcurl_imp.lib to Additional Dependencies and added CURL_STATICLIB to the Preproccessor definitions, I get 14 linker errors when creating it. I checked the cURL FAQ and some Google errors, but I haven't found a solution yet. The linker errors are as follows:

1>-------.obj : error LNK2031: unable to generate p/invoke for "extern "C" void __clrcall curl_easy_cleanup(void *)" (?curl_easy_cleanup@@$$J0YMXPAX@Z); calling convention missing in metadata
1>-------.obj : error LNK2031: unable to generate p/invoke for "extern "C" enum CURLcode __clrcall curl_easy_perform(void *)" (?curl_easy_perform@@$$J0YM?AW4CURLcode@@PAX@Z); calling convention missing in metadata
1>-------.obj : error LNK2031: unable to generate p/invoke for "extern "C" enum CURLcode __clrcall curl_easy_setopt(void *,enum CURLoption,...)" (?curl_easy_setopt@@$$J0YM?AW4CURLcode@@PAXW4CURLoption@@ZZ); calling convention missing in metadata
1>-------.obj : error LNK2031: unable to generate p/invoke for "extern "C" void * __clrcall curl_easy_init(void)" (?curl_easy_init@@$$J0YMPAXXZ); calling convention missing in metadata
1>-------.obj : error LNK2028: unresolved token (0A00000E) "extern "C" void __clrcall curl_easy_cleanup(void *)" (?curl_easy_cleanup@@$$J0YMXPAX@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1>-------.obj : error LNK2028: unresolved token (0A00000F) "extern "C" enum CURLcode __clrcall curl_easy_perform(void *)" (?curl_easy_perform@@$$J0YM?AW4CURLcode@@PAX@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1>-------.obj : error LNK2020: unresolved token (0A000010) "extern "C" enum CURLcode __clrcall curl_easy_setopt(void *,enum CURLoption,...)" (?curl_easy_setopt@@$$J0YM?AW4CURLcode@@PAXW4CURLoption@@ZZ)
1>-------.obj : error LNK2020: unresolved token (0A000011) "extern "C" enum CURLcode __clrcall curl_easy_setopt(void *,enum CURLoption,...)" (?curl_easy_setopt@@$$J0YM?AW4CURLcode@@PAXW4CURLoption@@ZZ)
1>-------.obj : error LNK2028: unresolved token (0A000012) "extern "C" void * __clrcall curl_easy_init(void)" (?curl_easy_init@@$$J0YMPAXXZ) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1>-------.obj : error LNK2019: unresolved external symbol "extern "C" void __clrcall curl_easy_cleanup(void *)" (?curl_easy_cleanup@@$$J0YMXPAX@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1>-------.obj : error LNK2019: unresolved external symbol "extern "C" enum CURLcode __clrcall curl_easy_perform(void *)" (?curl_easy_perform@@$$J0YM?AW4CURLcode@@PAX@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1>-------.obj : error LNK2001: unresolved external symbol "extern "C" enum CURLcode __clrcall curl_easy_setopt(void *,enum CURLoption,...)" (?curl_easy_setopt@@$$J0YM?AW4CURLcode@@PAXW4CURLoption@@ZZ)
1>-------.obj : error LNK2019: unresolved external symbol "extern "C" void * __clrcall curl_easy_init(void)" (?curl_easy_init@@$$J0YMPAXXZ) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)

(I obscured the name of the project.)

What does this mean, how can I prevent this? Thank:)


UPDATE

I switched to Code :: Blocks and now become the native Win32 graphical application. I do not get all these linker errors, but I get something:

ld.exe cannot find -lcurl.lib

include lib . , lib - libcurl.lib, curl.lib. , ?

EDIT: , , libcurl.lib .


-lcurl " ",

ld.exe cannot find -lcurl

.lib.

+3
1

, , (32 64 , ).

0

Source: https://habr.com/ru/post/1790549/


All Articles