cURL LNK2019 error: linking error

I'm trying to use cURL with Visual C++ 2008 Express...

First of all, I'm using the recent release of cURL: v7.21.7. I've successfully built cURL 7.21.7...and included the headers and library files in visual c++'s properties...now, here's my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdafx.h>
#include <iostream>
#include <curl/curl.h>
#include <string>

using namespace std;

int main(void)
{
  CURL* curl; //our curl object

    curl_global_init(CURL_GLOBAL_ALL); //pretty obvious
    curl = curl_easy_init();


  
  return 0;
}



At the moment I just want to get the declarations correct so that I can check that the installation was done correctly...here are the errors I receive when trying to build:

1>curl.obj : error LNK2001: unresolved external symbol "extern "C" enum CURLcode __cdecl curl_global_init(long)" (?curl_global_init@@$$J0YA?AW4CURLcode@@J@Z)
1>curl.obj : error LNK2001: unresolved external symbol "extern "C" void * __cdecl curl_easy_init(void)" (?curl_easy_init@@$$J0YAPAXXZ)
1>C:\Documents and Settings\Lauren\My Documents\Visual Studio 2008\Projects\curl\Release\curl.exe : fatal error LNK1120: 2 unresolved externals

I understand that LNK2019 means that the compiler doesn't recognize the symbol, I need to add a declaration...does this mean that the installation of cURL-7.21.7 was not installed successfully..?
Last edited on
Weird. I though libcurl already did this.
Try
1
2
3
extern "C"{
#include <curl/curl.h>
}
I fixed anumber of things forget the errors above...the problem now, though, is that when I build curl-7.21.7 I receive 65 errors like this one:

1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _win32_cleanup
Last edited on
Topic archived. No new replies allowed.