.Hi, this is my first C++ forum post. I'm having issues with including the library libcurl (found here). I want to include it in my project so I can start working with it, because a friend of mine showed me just how powerful the library is. These are my specs:

Compiler: CodeLite
Linux Version: 10.40.1 Unbuntu

Please help me out with this. I've searched for, and found multiple tutorials on downloading the files. I believe I have the proper files downloaded, but have no idea how to utilize them. I am fairly new to Linux itself, but not computers at all.

If you could explain to me how to include the source files in this project to me, I'd really be grateful. Thank-you!

Recommended Answers

All 9 Replies

You should be able to install the libraries via: sudo apt-get install curl libcurl4-dev libcurl4-gnutls-dev libcurl4-openssl-dev

from any terminal

I am not sure what you are attempting but none-the-less be cautious of the linker.

I've installed the libraries, but I don't understand how to include them in my project. It's confusing. I try to just go in and do

#include <curl.h>

and it cannot find the file. What's the deal?

The problem your having is:

#include <curl.h>

should be:

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

Check out these C API Examples

Alright, I will when I get home. Thanks.

Also, will this work properly with C++? This also seems to confuse me. It's a C library. I don't know how to install the wrapper, I'll try again later.

My bad didn't catch you were using C++...

Anyway you can get to the curl++ wrapper @ Curl++ Homepage and the Examples

My bad didn't catch you were using C++...

Anyway you can get to the curl++ wrapper @ Curl++ Homepage and the Examples

I'm having issues with this, too. All seemed to install well, and then I got this message after following a guide in a text file and using make install:

Making install in lib
make[1]: Entering directory `/home/john/Desktop/curl-7.21.2/lib'
make[2]: Entering directory `/home/john/Desktop/curl-7.21.2/lib'
test -z "/usr/local/lib" || mkdir -p -- "/usr/local/lib"
 /bin/bash ../libtool --mode=install /usr/bin/install -c  'libcurl.la' '/usr/local/lib/libcurl.la'
libtool: install: /usr/bin/install -c .libs/libcurl.so.4.2.0 /usr/local/lib/libcurl.so.4.2.0
/usr/bin/install: cannot create regular file `/usr/local/lib/libcurl.so.4.2.0': Permission denied
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory `/home/john/Desktop/curl-7.21.2/lib'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/john/Desktop/curl-7.21.2/lib'
make: *** [install-recursive] Error 1

It's a prermission issue with the OS...

instead of running:

make install

run:

sudo make install

hth's

Any status on this?

Any status on this?

I can't get this working with C++, however, it's working fine with C. I'm having confusion with installing the wrapper, it's just not working for me and I've Googled multiple methods.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.