Examples are wrong?

25 views
Skip to first unread message

linuxdude

unread,
Oct 1, 2009, 2:50:01 PM10/1/09
to curlpp
Hey,
I just installed Curlpp and the examples don't seem to work at all.

I had to change http://curlpp.org/index.php/examples/47-example-00
to
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>


using namespace cURLpp::Options;

int main(int, char **)
{
try {
// That's all that is needed to do cleanup of used resources
(RAII style).
cURLpp::Cleanup myCleanup;
// Our request to be sent.
cURLpp::Easy myRequest;
// Set the URL.
myRequest.setOpt(new cURLpp::Options::Url("http://
example.com"));
// Send request and get a result.
// By default the result goes to standard output.
myRequest.perform();
}
catch(cURLpp::RuntimeError & e) {
std::cout << e.what() << std::endl;
}
catch(cURLpp::LogicError & e) {
std::cout << e.what() << std::endl;
}
return 0;
}

Quite a lot of changes here is the diff

1c1
< #include <curlpp/cURLpp.hpp>
---
> #include <curlpp/curlpp.hpp>
5c5
< using namespace cURLpp::Options;
---
> using namespace curlpp::options;
11c11,12
< cURLpp::Cleanup myCleanup;
---
> curlpp::Cleanup myCleanup;
>
13c14,15
< cURLpp::Easy myRequest;
---
> curlpp::Easy myRequest;
>
15,16c17,18
< myRequest.
< setOpt(new cURLpp::Options::Url("http://example.com"));
---
> myRequest.setOpt < Url > ("http://example.com");
>
21c23,24
< catch(cURLpp::RuntimeError & e) {
---
>
> catch(curlpp::RuntimeError & e) {
24c27,28
< catch(cURLpp::LogicError & e) {
---
>
> catch(curlpp::LogicError & e) {
26a31
>

It seems all are like this. Did curlpp just change interfaces?
Thanks for the help though. The example still helped :-D

Piotr Dobrogost

unread,
Oct 1, 2009, 2:56:14 PM10/1/09
to curlpp
> It seems all are like this.  Did curlpp just change interfaces?

Yes. Using mixed case filenames and namespaces in the past wasn't good
idea.

linuxdude

unread,
Oct 1, 2009, 3:00:28 PM10/1/09
to curlpp
So, do I have an outdated version of curlpp or is the mixed case the
new interface? I have 0.7.2. Should I be using the 0.7.3 pre2?

On Oct 1, 1:56 pm, Piotr Dobrogost <p...@2009.gmane.dobrogost.pl>
wrote:

Jean-Philippe Barette-LaPierre

unread,
Oct 1, 2009, 3:16:52 PM10/1/09
to cur...@googlegroups.com
On Thu, Oct 1, 2009 at 3:00 PM, linuxdude <michael....@gmail.com> wrote:
>
> So, do I have an outdated version of curlpp or is the mixed case the
> new interface?  I have 0.7.2.  Should I be using the 0.7.3 pre2?
>

Yes. This version will be released as soon as I stop being lazy.

linuxdude

unread,
Oct 1, 2009, 4:37:37 PM10/1/09
to curlpp
Ok,
The examples are working now with the new version. Thank you very
much.

--Michael

On Oct 1, 2:16 pm, Jean-Philippe Barette-LaPierre
<jpbarre...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages