This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.1)
- From: "Kowen" <kowen at nildram dot co dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 25 Feb 2003 23:46:23 -0000
- Subject: gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.1)
- Reply-to: "Kowen" <kowen at nildram dot co dot uk>
I am trying to compile the following simple app but get the following error:
g++ -Wno-ctor-dtor-privacy -DLINUX -D_RWCONFIG -D_RWCONFIG=15d
-I/home/kowen1/SourcePro/include -I/home/kowen1/SourcePro
-L/home/kowen1/SourcePro/lib -lstd3015d -ltls7715d -lpthread test.cpp
test.cpp: In function `int main ()':
test.cpp:11: could not convert `RWCString("HA")' to `RWCString &'
test.cpp:4: in passing argument 1 of `testref (RWCString &)'
RWCString is a RW string class. This code compiles with Sun's SunPro5.3 and
MS Visual Studio 6. How can I get it to compile with g++.
Thanks for your help.
Keith
#include <rw/rwstring.h>
#include <rw/rstream.h>
void testref(RWCString &);
main()
{
RWCString x("Hello");
testref(x);
testref(RWCString("HA"));
}
void testref(RWCString & p)
{
p.toUpper();
cout << p << endl;
}