problem compiling static const char arrays in 2.95.3 (attached code)

Deno, Emerson edeno@blackrock.com
Tue Aug 15 09:29:00 GMT 2000


I 'm having a problem compiling (actually, linking) a very short program in
g++ 2.95.3

				#include <stdio.h>

				class A
				{
				  public:
				    static const char name[] = "ME";

				};


				main()
				{
				    printf("I AM %s",A::name);
				}


GCC: 	Reading specs from
/u1/edeno/latest-gcc/target/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.3/specs
	gcc version 2.95.3 19991030 (prerelease)
System Type:  Solaris 2.5.1
Output: 
			Undefined                       first referenced
			 symbol                             in file
			A::name
/var/tmp/ccpupQ7o.o
			ld: fatal: Symbol referencing errors. No output
written to a.out
			collect2: ld returned 1 exit status
Options: -fsquangle
 <<simple.ii>> the preprocessed code


       
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.ii
Type: text/x-c++
Size: 3426 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000815/cb8d6850/attachment.bin>


More information about the Gcc-bugs mailing list