Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I am using Dev-cpp - 22.214.171.124 On Windows XP
I want to use curl in my project built using devcpp
So I created a static library (project) in devcpp for the same.
I have include all the necessary curl files in it.
Then i created a console project,
But i have no idea as to how to link to my static library
While running the following code
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, "[url]http://example.com[/url]");
res = curl_easy_perform(curl);
/* always cleanup */
The compiler is giving me the following error
[Linker Error] undefined reference to `curl_easy_init'
[Linker Error] undefined reference to `curl_easy_setopt'
[Linker Error] undefined reference to `curl_easy_perform'
[Linker Error] undefined reference to `curl_easy_cleanup'
ld returned 1 exit status
E:\wamp\www\jm\yy\Makefile.win [Build Error] [Output/MingW/Project4.exe] Error 1
I tried to add the library (libcurl.a, libcurldll.a) and other libraries
But nothing Works.
1) click on the Projects ->"Project Options"->"Parameters"
2) under "Linker", where it says: "Add Library or Object",
click that button,
3) scan across the list until you find the library you want to link,
(**if libcurl.a is not in the default /lib/ folder, then select the correct
Double click on it,
that will place libcurl.a in the linker list,
repeat process for more libraries,
4) click on the OK button to close that window,
5) Under FILE, click on "Save All",
6) Under Execute, click on "Rebuild All"
When you open the project are the librarys in the project?
Sometimes the order the libraries are listed in projects affects linking, try
swapping order of file.a and file.dll .
I dont do much programing with libraries, but do you really need both the .a
and .dll files, try using just the .a file.
Is the library in the project directory? Try a copy of the library in project