Hi list,

Im trying to use xmlrpc-socket, taken from
http://www.tntnet.org/howto/xmlrpc-howto.html

So i created a file tntsocketserver  (original code from tntnet.org):
-------------- snip -------------------------------
#include <cxxtools/eventloop.h>
#include <cxxtools/http/server.h>
#include <cxxtools/xmlrpc/service.h>


double add(double a1, double a2)
{
    return a1 + a2;
}

double sub(double a1, double a2)
{
    return a1 - a2;
}
int main(int argc, char* argv[])
{
    try
    {
        // Define a event loop
        cxxtools::EventLoop loop;

        // Define a http server first
        cxxtools::http::Server httpServer(loop, 8077);

        // for xml rpc we need a service object
        cxxtools::xmlrpc::Service service;

        // register the methods
        service.registerFunction("add", add);
        service.registerFunction("sub", sub);

        // ... and register the service under a url
        httpServer.addService("/xmlrpc", service);

        // and run our server
        loop.run();
    }
    catch (const std::exception& e)
    {
        std::cerr << e.what() << std::endl;
    }
}
-------------- snip -------------------------------
# gcc -o tntsocketserver.o tntsocketserver.cpp
tntsocketserver.cpp: In function ‘int main(int, char**)’:
tntsocketserver.cpp:40:9: error: ‘cerr’ is not a member of ‘std’
         std::cerr << e.what() << std::endl;
         ^

including <iostream> didnt help also.

Whats wrong here?

Tfh!
Oliver


------------------------------------------------------------------------------
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to