🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Norbert Hoelken Mon, 06 Apr 1992 20:08
gcc 2.1
#155
Author: Norbert Hoelken
Date: Mon, 06 Apr 1992 20:08
50 lines
1447 bytes
I just received version 2.1 of GNU CC, but there seems to be a bug with static
data members in C++.

I installed gcc 2.1 on a Sun4/75 running SunOS 4.1.1 using 'configure sparc'.
Using this compiler i installed libg++ 2.0.

The following program was compiled without any options (only saying
g++ <name>.cc) and produced the linker error

		undefined reference to `__4test$Global_Value'

I tried all combinations of GNU as/ld and systems as/ld with the same result.
The error disappeares when i try to initialize the static member Global_Value
(commented out in the example).

The program works fine with an old release of g++ (g++ 1.37.1).

--- example -----
#include <stream.h>

class test
{
  public:
    test();
    ~test() {}
    static int Global_Value;
};

test::test()
{
    cout << Global_Value << "\n";
}

// int test::Global_Value = 1;

int main()
{
    test *t_ptr;
    t_ptr = new test;
}
------ end --------


			Thanks,

			Norbert Hoelken
			FhG-IML
			Emil-Figge-Str. 75
			D-4600 Dortmund 50 (FRG)
			email: hoelken@iml.fhg.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads