This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

c++/8021: undefined reference to virtual thunk


>Number:         8021
>Category:       c++
>Synopsis:       undefined reference to virtual thunk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 24 07:56:04 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Grigory Zagorodnev
>Release:        3.2
>Organization:
>Environment:
Red Hat Linux release 7.3.94 ((null))
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 (Red Hat Linux Rawhide 3.2-1)
>Description:
The Issue
---------
G++ compiler gives "undefined reference to `virtual thunk..." error message while building the following test-case.

Testcase
--------
	struct C3 {
	    virtual int f8() { }
	};
	
	struct C4: virtual C3 { };
	
	struct C2: virtual C3,  C4 {
	    int i;
	    virtual int f8() {}
	};
	
	struct C1: virtual C2 {
	};
	
	C1 o1;
	
	int main() {
	    return 0;
	}

Command line is:
	$ g++ -c fail.cpp
	$ g++ fail.o

Error Message
-------------
fail.o(.gnu.linkonce.r._ZTC2C14_2C2+0x20): undefined reference to `virtual thunk [v:0,-12] to C2::f8()'
fail.o(.gnu.linkonce.r._ZTV2C1+0x14): undefined reference to `virtual thunk [v:0,-12] to C2::f8()'
collect2: ld returned 1 exit status
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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