error LNK2019: external symbol undefined when trying to use libcurl

1

Hello, I'm trying to compile a static libcurl library, but without success.

I downloaded the source code for libcurl version 7.55.1 available at link . After the download completes I extracted the contents to the local disk.

I opened the Developer Command Prompt for Visual Studio and used cd C:\curl\winbuild . In this folder there is an instruction file of how to compile for Windows. I ran the following command line at the prompt.

nmake /f Makefile.vc mode=static DEBUG=no MACHINE=x86

When the process finished, there were files in the C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl directory. I added the C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\include directory to Diretórios de Inclusão Adicionais and C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\lib to Diretórios de Biblioteca Adicionais .

And in my source code I added the following code to the top:

#include <curl\curl.h>
#pragma comment(lib, "libcurl_a.lib")

When I try to compile the sample code from this address link I get several errors about symbols indefinite.

1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_global_init referenciado na função _WinMain@16
1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_global_cleanup referenciado na função _WinMain@16
1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_easy_strerror referenciado na função _WinMain@16
1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_easy_init referenciado na função _WinMain@16
1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_easy_setopt referenciado na função _WinMain@16
1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_easy_perform referenciado na função _WinMain@16
1>main.obj : error LNK2019: símbolo externo indefinido __imp__curl_easy_cleanup referenciado na função _WinMain@16

I have already tried using different options for compilation, I even compiled using the project for Visual Studio which comes bundled with the source code of libcurl and is located in C:\curl\projects\Windows\VC14 . Also unsuccessful.

I'm waiting for a tip to solve this problem, thank you.

    
asked by anonymous 13.09.2017 / 17:49

0 answers