This is the mail archive of the gcc@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]

GCC 2.95.1 static string won't compile on SCO-OSR5


Hellow,

I'm trying to compile the following example: 

----------
#include <string>

class ctest
{
public:
        static string   foo;
};

string  ctest::foo;

void main()
{
        ctest::foo = "bar";
}
----------

Which is no problem using EGCS 1.1.1 on the same machine. GCC 2.95.1 won't
do it however:

----------
[ildev2] /usr/rob> /usr/local/gcc-2.95.1/bin/g++ test.cc
/usr/local/gcc-2.95.1/lib/gcc-lib/i586-pc-
sco3.2v5.0.0/2.95.1/libstdc++.a(cstrmain.o): fatal error: symbol `__as__t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_tem
plate2b0i0PCc` multiply-defined, also in file /usr/tmp/cc4lMcjd.o
collect2: ld returned 1 exit status [ildev2] /usr/rob> ----------

I can't make any sense of this error... Does this mean my GCC install is broken (again), or is this invalid C++?

Thanks!

 Rob Kramer
 robk@cyberway.com.sg




--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.

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