I just downloaded and unpacked the code, but after typing "make" the compile fails. I'm a C coder, so I'm not too sure what the C++ errors mean....
The readme said something about modifying the Makefile to suit my system, but I didn't see anything that needed to be changed? I'm assuming I'm just missing something. I tried this on 2 linux machines and my Cygwin install under Windows with the same results below. Any ideas what I'm doing wrong?
Thanks in advance.
---
[mrflippy@tallest xmlrpc++0.5]$ make
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcClient.o src/XmlRpcClient.cpp
In file included from src/XmlRpc.h:31,
from src/XmlRpcClient.cpp:5:
src/XmlRpcValue.h: In method `const XmlRpc::XmlRpcValue
&XmlRpc::XmlRpcValue::operator[] (int) const':
src/XmlRpcValue.h:94: no matching function for call to
`vector<XmlRpc::XmlRpcValue, allocator<XmlRpc::XmlRpcValue> >::at (int
&)'
src/XmlRpcValue.h: In method `XmlRpc::XmlRpcValue
&XmlRpc::XmlRpcValue::operator[] (int)':
src/XmlRpcValue.h:95: no matching function for call to
`vector<XmlRpc::XmlRpcValue, allocator<XmlRpc::XmlRpcValue> >::at (int
&)'
make: *** [src/XmlRpcClient.o] Error 1
---
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The error is due to an out of date C++ compiler (actually it is the C++ standard library header file <vector> that is out of date). The vector template is supposed to define a method "at(const int&)".
You could update your compilers (I know g++ 3.1 works, but haven't tried anything else), or you could edit lines 94 and 95 of XmlRpcValue.h and change the lines that contain references to "at" such as this:
_value.asArray->at(i)
to look more like this:
(*(_value.asArray))[i]
to invoke the array access operator (which is what the at method does). Or it could be:
_value.asArray->operator[](i)
but that syntax is pretty awful.
There may be other issues though if your compilers are very out of date.
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-02-01
which g++ you use definitly makes a difference. I tried using g++2.95, I was getting similar errors, so I installed g++3.0 and that works great. I am runing debian linux.
Again this is a great library.
g++ 3.2 works too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it just the STL vector::at(const int&) method that is causing the problems? If so, I can use one of the alternatives in the next release. If there are a bunch of other issues then I would just as soon keep the cleaner code provided by the at method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-02-07
There is another issue compiling with g++ 2.95. for some reason it gives this error which does not make any sense to me. Any ideas ? I wish I could use g++ 3.0 and up.
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcValue.o src/XmlRpcValue.cpp
In file included from src/XmlRpcValue.cpp:4:
src/base64.h:39: parse error before `<'
src/base64.h:45: confused by earlier errors, bailing out
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcValue.o src/XmlRpcValue.cpp
In file included from src/XmlRpcValue.cpp:4:
src/base64.h:39: parse error before `<'
src/base64.h:45: confused by earlier errors, bailing out
That line is declaring the base64 template. I don't know what could be wrong other than the compiler not supporting it. You could remove base64 support by removing the base64.h include and the two places where it is used in XmlRpcValue.cpp, but upgrading your compiler would be the best solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I just downloaded and unpacked the code, but after typing "make" the compile fails. I'm a C coder, so I'm not too sure what the C++ errors mean....
The readme said something about modifying the Makefile to suit my system, but I didn't see anything that needed to be changed? I'm assuming I'm just missing something. I tried this on 2 linux machines and my Cygwin install under Windows with the same results below. Any ideas what I'm doing wrong?
Thanks in advance.
---
[mrflippy@tallest xmlrpc++0.5]$ make
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcClient.o src/XmlRpcClient.cpp
In file included from src/XmlRpc.h:31,
from src/XmlRpcClient.cpp:5:
src/XmlRpcValue.h: In method `const XmlRpc::XmlRpcValue
&XmlRpc::XmlRpcValue::operator[] (int) const':
src/XmlRpcValue.h:94: no matching function for call to
`vector<XmlRpc::XmlRpcValue, allocator<XmlRpc::XmlRpcValue> >::at (int
&)'
src/XmlRpcValue.h: In method `XmlRpc::XmlRpcValue
&XmlRpc::XmlRpcValue::operator[] (int)':
src/XmlRpcValue.h:95: no matching function for call to
`vector<XmlRpc::XmlRpcValue, allocator<XmlRpc::XmlRpcValue> >::at (int
&)'
make: *** [src/XmlRpcClient.o] Error 1
---
The error is due to an out of date C++ compiler (actually it is the C++ standard library header file <vector> that is out of date). The vector template is supposed to define a method "at(const int&)".
See http://www.tacc.utexas.edu/resources/user_guides/pgi/pgC++_lib/stdlibcr/vec_0251.htm#Member%20Functionsat\()
You could update your compilers (I know g++ 3.1 works, but haven't tried anything else), or you could edit lines 94 and 95 of XmlRpcValue.h and change the lines that contain references to "at" such as this:
_value.asArray->at(i)
to look more like this:
(*(_value.asArray))[i]
to invoke the array access operator (which is what the at method does). Or it could be:
_value.asArray->operator[](i)
but that syntax is pretty awful.
There may be other issues though if your compilers are very out of date.
Chris
which g++ you use definitly makes a difference. I tried using g++2.95, I was getting similar errors, so I installed g++3.0 and that works great. I am runing debian linux.
Again this is a great library.
g++ 3.2 works too.
Neither 2.96 or 3.0.4 worked for me (using Redhat 7.x). I hade to use 3.2 (included with Redhat 8).
Is it just the STL vector::at(const int&) method that is causing the problems? If so, I can use one of the alternatives in the next release. If there are a bunch of other issues then I would just as soon keep the cleaner code provided by the at method.
There is another issue compiling with g++ 2.95. for some reason it gives this error which does not make any sense to me. Any ideas ? I wish I could use g++ 3.0 and up.
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcValue.o src/XmlRpcValue.cpp
In file included from src/XmlRpcValue.cpp:4:
src/base64.h:39: parse error before `<'
src/base64.h:45: confused by earlier errors, bailing out
g++ -g -Wall -Wstrict-prototypes -O2 -I./src -c -o src/XmlRpcValue.o src/XmlRpcValue.cpp
In file included from src/XmlRpcValue.cpp:4:
src/base64.h:39: parse error before `<'
src/base64.h:45: confused by earlier errors, bailing out
That line is declaring the base64 template. I don't know what could be wrong other than the compiler not supporting it. You could remove base64 support by removing the base64.h include and the two places where it is used in XmlRpcValue.cpp, but upgrading your compiler would be the best solution.