🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #209

g++ bug: unresolved static member at link time

#209
From: Eric M. Carroll
Date: Wed, 29 Jul 1992 15:15
67 lines
2472 bytes
* Environment: 
	Sun SPARCStattion 1+, SunOS 4.1.1 + many patches
	GCC 2.2.2

* Problem:
	* static member ComponentDisplay::value is unresolved at link time
	if UIDisplay::eventProc is commented out.

	* removing comments from UIDisplay::eventProc results in cc1plus
	receiving fatal signal 11 (reported in last message).

* Repeat By:

g++ -v tmp.cc -lxview -o out
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix tmp.cc /usr/tmp/cca04629.i
GNU CPP version 2.2.2 (sparc)
 /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1plus /usr/tmp/cca04629.i -quiet -dumpbase tmp.cc -version -o /usr/tmp/cca04629.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
 as -o tmp.o /usr/tmp/cca04629.s
 /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/ld -e start -dc -dp -o out /lib/crt0.o -L/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2 -L/usr/local/lib tmp.o -lxview -lg++ -lgcc -lc -lgcc
ld: Undefined symbol 
   __16ComponentDisplay$value 
collect: /usr/bin/ld returned 2 exit status

*Code Fragment

class UIDisplay  {
protected:
//    static long eventProc (long,
//			     long *,
//			     long, 
//			     long);
} ;

class ComponentDisplay: public UIDisplay {
 protected:
    static int value ;
    static void		 backgroundEventProc () ;
    static long          eventProc (long,
				    long *,
				    long,
				    long);
} ;
void ComponentDisplay::backgroundEventProc ()
{
}

extern "C" { long  notify_interpose_event_func(long a, long (*func)()) ; } ;

long ComponentDisplay::eventProc (long win,
					  long             *event,
					  long         arg,
					  long  event_type)
{
    // Set the panel event proc
    notify_interpose_event_func (0L, eventProc);
    value = 0 ;

    return 0 ;
}

main() {

    return 0 ;
}
Technical Details
Message-ID: <9207291515.AA04644@cathaus.utcs.utoronto.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cathaus.utcs.utoronto.ca!eric

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cathaus.utcs.utoronto.ca!eric
From: eric@cathaus.utcs.utoronto.ca (Eric M. Carroll)
Subject: g++ bug: unresolved static member at link time
Message-ID: <9207291515.AA04644@cathaus.utcs.utoronto.ca>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 29 Jul 1992 15:15:31 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 68