PDA

View Full Version : How to compile xmlrpc++ libraries from a makefile



Andrea Landi
19th May 2011, 08:49
Hello guys, as you can imagine from the title I am quite newbie in programming in C + +.
Basically so far I have written a GUI in C + + using the Qt4 libraries and now, for a thesis project, I should integrate support for XML-RPC protocol to allow the software to make calls to methods implemented on a remote server.

Since it is the first time that I do these things (think that less than a month ago I was in "Hello World " c ++...) I am asking your help. Basically I downloaded the source code from http://xmlrpcpp.sourceforge.net/ site and into the zip I found a makefile ... now I read on the site that I should use the command "make " to build my version of the libraries from makefile but I also read that first I have to edit this makefile depending on my needs, on my compiler options etc..
Some of you would be kind enough to download the source code (less than 1 Megabyte) and explain me how I should change the makefile and how to use the make command?
I'm using the GNU compiler MinGW 4.4, O.S. Vista 32 bit.
Thanks for any replies

wysota
19th May 2011, 09:02
Have you tried just calling "make"? What was the output you got?

Andrea Landi
19th May 2011, 09:07
Hello, If I just type "make" nothing happens...If I use "mingw32-make" this is the output:


D:\Downloads\xmlrpc++0.7\xmlrpc++0.7>mingw32-make
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcClient.o src/XmlR
pcClient.cpp
cc1plus.exe: warning: command line option "-Wstrict-prototypes" is valid for Ada
/C/ObjC but not for C++
src/XmlRpcClient.cpp: In member function 'virtual bool XmlRpc::XmlRpcClient::rea
dHeader()':
src/XmlRpcClient.cpp:312: error: 'strncasecmp' was not declared in this scope
src/XmlRpcClient.cpp:314: error: 'strncmp' was not declared in this scope
src/XmlRpcClient.cpp: In member function 'virtual bool XmlRpc::XmlRpcClient::par
seResponse(XmlRpc::XmlRpcValue&)':
src/XmlRpcClient.cpp:397: warning: suggest parentheses around '&&' within '||'
mingw32-make: *** [src/XmlRpcClient.o] Error 1

wysota
19th May 2011, 09:38
The code is broken, it won't build without manual tweaking. The project hasn't been maintained for 8 years.

Andrea Landi
19th May 2011, 09:59
And what about this project for xml-rpc?
http://wiedi.frubar.net/blog/2008/03/08/libmaia-xml-rpc-with-qt4/

wysota
19th May 2011, 12:03
It's also quite old.

Andrea Landi
19th May 2011, 15:02
And so what I should use to implement xml-rpc?

wysota
19th May 2011, 15:34
xml-rpc is a broad definition. Are you after "xml-rpc" (first generation of rpc protocols) specifically or after xml based rpc in general?

Andrea Landi
19th May 2011, 19:10
I'll explain...For my thesis I have to send commands, from a software I wrote in QT, to a building automation system in order to perform certain actions (e.g. open a door) . From the specs I know I can communicate with the server using Xml-Rpc. According to the PDF that was given to me, the system XML-RPC is a method of procedure calling using HTTP as the transport and XML as the enconding. On this PDF there is also written that "Johnson controls" (the producer of the system) recommends, for C++ application, the XmlRpc++ implementation by Chris Morley (that is the library I was trying to build). I am a biomedical engineering student not a computer science or telecommunications one so I feel a little lost with this...please help me :(

wysota
19th May 2011, 21:13
So I guess you need xml-rpc and nothing else. Maybe you have more luck with this one: http://xmlrpc-c.sourceforge.net/

SixDegrees
20th May 2011, 07:24
I don't think the package you're trying to use is broken. I think you're not using it correctly.

As it says, you have to edit the makefile to accomodate the compiler you're using, and probably to take the system you're running on into account. Read the instructions that come with the package for what you have to change specifically and how to change it.

wysota
20th May 2011, 07:34
I was trying to build it on my box. The code needs editing, for example there are missing includes there.

SixDegrees
20th May 2011, 07:40
I was trying to build it on my box. The code needs editing, for example there are missing includes there.

Depends on what compiler you're using. It seems to have been built a long time ago, when strings.h, string.h and stdlib.h were included by default by a lot of compilers. Those include statements have to be added to the appropriate files for use with modern compilers.

It took about five minutes to work through these issues. Whatever function the compiler is griping about, just pull a man page on it to see what header file it lives in, and include that header in the file. The three listed seem to be commonly missing.

Or, you could revert to gcc 2.95. It would probably compile out of the box with that.

There are some C++ issues with some of the test programs, but given that most of them compile and link I'm guessing the library itself built correctly.

To the OP: it's surprising that someone working on a thesis would need this sort of help.

Andrea Landi
20th May 2011, 08:31
I said it before...I just had a 3 months very basic (we didnt discuss about pointers nor OOP) course on c++ on my first year of university...then nothing else about C++. All the other times we needed to program on a computer we used MATLAB, so I am far more experienced on it.
And for my thesis they asked me to do this in C++...for me being able to create a whole GUI using QT just using code (not designer) and integrating it with OpenCV to make it display processed video is a big result :D
Now I just need, from my software, to send commands to this server and receive feedbacks from it...I dont need to program a server (well, maybe only for simulation purposes, but a real server with implemented methods is already running in the building and I just need to interface with it).

That's why I said I need something as easy as possible to use and well documented.

Other question: do you suggest to study a little XML before diving into XML-RPC?

Thanks