delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/02/18/06:10:30

Delivered-To: listarch-cygwin AT sourceware DOT cygnus DOT com
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Graham Dumpleton <Graham DOT Dumpleton AT ra DOT pad DOT otc DOT com DOT au>
Message-Id: <199902180541.QAA10201@baldric.pad.otc.com.au>
Subject: B20.1/EGCS1.1.1: undefineds with -frepo
To: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Date: Thu, 18 Feb 1999 16:41:28 +1100 (EST)
Cc: cygwin AT sourceware DOT cygnus DOT com
In-Reply-To: <Pine.SUN.3.93.990216222406.25483G-100000@modi.xraylith.wisc.edu> from "Mumit Khan" at Feb 16, 99 10:38:11 pm
X-Mailer: ELM [version 2.4 PL24]

Am getting many undefined symbols when using -frepo option on EGCS 1.1.1 to
handle templates. The package I am trying to build is OSE.

I have also been having trouble using -frepo with Cygnus GNUPro C++ 98r2 on
Solaris as well. When I got a small test program together to show the
problem in Cygnus GNUPro, I found it also showed a problem in EGCS 1.1.1
although the set of undefined symbols was actually quite different which
was quite amusing. The good thing was I could send the same test program to
this mailing list and Cygnus which saved me a bit of work, although I think
this may only be the start of the problems I find. :-(

The test program is:

  template<class T>
  class ONE
  {
    public:
      virtual ~ONE();
  };

  template<class T>
  ONE<T>::~ONE() { }

  template<class T>
  class TWO
  {
    public:
      TWO();
  };

  template<class T>
  TWO<T>::TWO()
  {
    new ONE<T>;
  }

  main(int argc, char* argv[])
  {
    TWO<int> obj;

    return 0;
  }

When put in a file called bug.cc and with the commands:

  g++ -frepo -c bug.cc
  g++ bug.o

it generates:

  bug.o(.text+0x10):bug.cc: undefined reference to `TWO<int>::TWO(void)'
  collect2: ld returned 1 exit status

Adding -frepo to the final link line makes no difference.

On Cygnus GNUPro C++ 98r1 this test program works fine, although it has
problems on Cygnus GNUPro C++ 98r2.

I have actually gone back now and managed to build OSE fine using -frepo
with Cygnus GNUPro C++ 98r1, so it isn't the way I am doing things.

-- 
Graham Dumpleton (grahamd AT nms DOT otc DOT com DOT au)

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019