Subject: B20.1/EGCS1.1.1: undefineds with -frepo
From: Graham Dumpleton <[email-masked]>
To: [email-masked] (Mumit Khan)
Cc: [email-masked]
Date: Thu, 18 Feb 1999 16:41:28 +1100 (EST)

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 ([email-masked])

--
Want to unsubscribe from this list?
Send a message to [email-masked]