This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]