This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
problem compiling static const char arrays in 2.95.3 (attached code)
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>, "'bug-gcc at gnu dot org'" <bug-gcc at gnu dot org>
- Subject: problem compiling static const char arrays in 2.95.3 (attached code)
- From: "Deno, Emerson" <edeno at blackrock dot com>
- Date: Tue, 15 Aug 2000 12:29:01 -0400
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
simple.ii