code
code

Reputation: 5642

Trouble linking/compiling Libcurl in Eclipse IDE C++ Project

Hi I am having trouble configuring an Eclipse C++ (32bit) project to use libcurl. I am using MinGW. I am on a 64bit windows OS. I have done the following so far:

However, I am seeing the following message:

Info: Internal Builder is used for build
g++ "-LC:\\projectsrc\\Network\\curl-7.34.0-win32\\lib" "-LC:\\projectsrc\\Network\\curl-7.34.0-win32\\dlls" "-LC:\\projectsrc\\Network\\curl-7.34.0-win32\\bin" -o TestLibCurl.exe "src\\TestLibCurl.o" "-lC:\\projectsrc\\Network\\curl-7.34.0-win32\\lib\\libcurl.lib" 
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lC:\projectsrc\Network\curl-7.34.0-win32\lib\libcurl.lib
collect2.exe: error: ld returned 1 exit status

Below is the sample source

#include <stdio.h>
#include <curl/curl.h>
#include <curl/easy.h>

#include <string>
#include <sstream>
#include <iostream>
using namespace std;

int main()
{
     cout << "test" <<< endl;
     return 0;
}

Below is a screenshot of where I added the include path and the library file:

enter image description here

For your reference, I have uploaded my sample C++ eclipse project to dropbox here: https://www.dropbox.com/s/2jowlkz6qypqe9g/TestingLibCurl.zip

The project file includes main.cpp, the libcurl.lib file, the libcurl header files, and the eclipse project setting files (.cproject, .project, .settings)

Oddly, I am able to get this to work in CodeBlocks IDE, using the same MinGW and using the same computer (Windows 64 bit). Do I need to add linker/options/flags when using Eclipse IDE?

Upvotes: 1

Views: 974

Answers (0)

Related Questions