delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/21/11:04:57

Date: Mon, 21 Feb 2000 11:05:30 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: bluerv AT my-deja DOT com
cc: djgpp AT delorie DOT com
Subject: Re: Linker error using templates
In-Reply-To: <88pi4l$qgl$1@nnrp1.deja.com>
Message-ID: <Pine.A41.4.05.10002211054540.34248-100000@ieva01.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

It is known problem. There are 2 possible solutions:

	- use gcc command line option -frepo (should work with Your
          installation). 

	- use binutils that supports weak symbols. Unfortunatelly none
          of official ports in DJGPP distribution does it. If You're
          really brave enough You can try recent binutils snapshots
          (I put precompiled binaries of 8 February snapshot at
	  http://www.lanet.lv/~pavenis/djgpp/bnu-000208.zip). NOTE once 
	  more: it's development version, it can crash, do other
          weird things, etc. Well that didn't happen to me. Also
	  You should use command line line option -mbnu210 to enable 
          gcc to use extra features of binutils snapshots (if this option
	  doesn't work, make sure You have latest update of gcc2952b.zip
	  and gpp2952b.zip)   

Andris

On Sun, 20 Feb 2000 bluerv AT my-deja DOT com wrote:

> Can someone explain to me what I'm doing wrong here?
> 
> My setup:
> 
> v2/djdev203.zip      DJGPP Basic Development Kit   1.5 mb
> 
> v2apps/rhide14b.zip  RHIDE                         1.6 mb
> 
> v2gnu/bnu281b.zip    Basic assembler, linker       1.8 mb
> v2gnu/gcc2952b.zip   Basic GCC compiler            1.8 mb
> v2gnu/gpp2952b.zip   C++ compiler                  1.6 mb
> v2gnu/lgpp295b.zip   C++ libraries                 484 kb
> v2gnu/mak3781b.zip   Make (processes makefiles)    257 kb
> 
> 
> The code:
> ---------------
> #include <string>
> 
> struct foo : public std::string_char_traits<char>
> {
> };
> 
> typedef basic_string<char, struct foo > CIString;
> 
> int main(void)
> {
>  CIString foo;
>  foo = "temp";
>  return 0;
> }
> ---------------
> 
> The error:
> 
> tempprob.o: In function `basic_string<char,
> foo,__default_alloc_template<false, 0> >::basic_string(void)':
> tempprob.cpp:1: undefined reference to `basic_string<char,
> foo,__default_alloc_template<false, 0> >::nilRep'
> make.exe: *** [tempprob.exe] Error 1
> 
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> 

- Raw text -


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