0

I have a project in VC++ where I am using libcurl library. Even after adding the library in Additional Dependencies I am facing around 150 unresolved external errors, all majorly for libcurl_a.lib file.

Error - 
1>OLDNAMES.lib(open.obi): warning LNK4049: locally defined symbol open imported

1>libcurl_a.lib(mime.obj): error LNK2019: unresolved external symbol imp__feof referenced 
1>libcurl_a.lib(mime.obj): error LNK2019: unresolved external symbol imp_access referenced in function Curl_mime_duppart in function _read_part content
1>OLDNAMES.lib(access.obi): error LNK2001: unresolved external symbol imp access
1>libcurl_a.lib(mime.obj): error LNK2019: unresolved external symbolimp_ stat64 referenced in function Curl_nine duppart 1>libcurl_a.lib(strerror.obj): error LNK2019: unresolved external symbolimp_strerror referenced in function Curl strerror
1>libcurl_a.lib(url.obj): error LNK2001: unresolved external symbol imp_strerror
1>1ibcurl_a.lib(telnet.obj): error LNK2001: unresolved external symbol imp_strncpy
1>1ibcurl_a.lib(ftp.obj): error LNK2001: unresolved external symbolimp_strncpy 
1>libcurl_alib(curl_sspi.obj): error LNK2001: unresolved external symbolimp_strncpy 
1>1ibcurl_s.lib(strerror.obj): error LNK2001: unresolved external symbolimp_strncpy
1>1ibcurl_a.lib(vtis.obj): error LNK2001: unresolved external symbol imp_strncpy 1>1ibcurl_.1ib(url.obj): error LNK2001: unresolved external symbolimp_strncpy
1>libcurl_a.lib(schannel.obj) error LNK 2001: unresolved external symbol_imp_strncpy 
1>libcuri_a.lip(strerror.obj) : error LNK2019: unresolved external symbol imp sys_nerr referenced in function Curi strerror
1>libcurl_a.lib(warnless.obj): error LNK2019: unresolved external symbol 1 OLDNAMES1ib(read.obi): error LNK2001: unresolved external symbolimp_read imp_read referenced in function curl_read
111bcurt a.lib/warmless.obj) error LNK2019: unresolved external symbol_imp_write referenced in function curl, weite

1 OLDNAMES-110(write.obi): error LNK2001: unresolved external symbolimp_write
drescherjm
  • 10,365
  • 5
  • 44
  • 64
  • 1
    Perhaps you are not properly linking libcurl. Perhaps you are using the wrong compiled binary for your compiler or mixing 32 and 64 bit. Maybe you put the wrong path in the linker dependency. – drescherjm Nov 15 '21 at 15:19
  • 1
    You will have to show some of the build output for a chance of help. I recommend copying at least some of the errors from the top of the Output tab (yes the Output tab and not the errors list) to the question. The output tab is in proper order and in a better text format. – drescherjm Nov 15 '21 at 15:24
  • 2
    Is this the problem: [https://stackoverflow.com/questions/46585662/windows-linking-to-libcurl-a-lib](https://stackoverflow.com/questions/46585662/windows-linking-to-libcurl-a-lib) – drescherjm Nov 15 '21 at 15:25
  • Hey, Thanks for looking into it, I have added some part of errors from Output tab. I have given the libcurl_a.lib path in the Linker->Input->Additional Dependency section – Anjali Singh Nov 15 '21 at 15:45
  • Did you add all the required library files and include header files? For your reference: [Create a client app that uses the DLL](https://learn.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-160#create-a-client-app-that-uses-the-dll) and [Error LNK2019](https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2019?view=msvc-170). – Minxin Yu - MSFT Nov 16 '21 at 06:41

1 Answers1

0

I have solved this problem by building the library with RTLIBCFG=static option.