gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.1)

Kowen kowen@nildram.co.uk
Tue Feb 25 23:46:00 GMT 2003


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;
}



More information about the Gcc-help mailing list