curl-library
Libcurl & Borland c++ 6 personal, linker errors
Date: Tue, 23 Jan 2007 22:48:12 +0100
Hello
I'm new to libcurl. I'm pretty new to programing in c too. I learned Pascal and switched to Free Pascal but now I learn c/c++.
I use Borland c++ Builder Personal because it is the software we use at my studies for programming lectures. I want to make an application that will automate some task on the Internet I must perform from time to time. My aim is to get these features: login via html forms to a site, get the cookie with the login session data, and do a few things when logged in.
But so far I tried the example source code (simple.c). It doesn't compile. I get these errors:
[Linker Error] Unresolved external '_curl_easy_init' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
[Linker Error] Unresolved external '_curl_easy_setopt' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
[Linker Error] Unresolved external '_curl_easy_perform' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
[Linker Error] Unresolved external '_curl_easy_cleanup' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
I downloaded the last curlib (libcurl-7.16.0-win32-ssl-sspi.zip). I copied the include folder to Borland’s include folder (both "CBuilder6/Include/curl" and "CBuilder6/Include"). I used implib.exe from "CBuilder6/bin" folder on the "libcurl-4.dll" to create "libcurl.lib" and I included it to my project (menu: Project->Add to project). The new "libcurl.lib" file is only 6 KB long while "libcurl-4.dll" 189 KB log.
I don't know what to do next.
The code I used:
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
Received on 2007-01-23