Date: Mon, 21 Feb 2000 11:05:30 +0200 (WET) From: Andris Pavenis 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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 > > struct foo : public std::string_char_traits > { > }; > > typedef basic_string CIString; > > int main(void) > { > CIString foo; > foo = "temp"; > return 0; > } > --------------- > > The error: > > tempprob.o: In function `basic_string foo,__default_alloc_template >::basic_string(void)': > tempprob.cpp:1: undefined reference to `basic_string foo,__default_alloc_template >::nilRep' > make.exe: *** [tempprob.exe] Error 1 > > > > Sent via Deja.com http://www.deja.com/ > Before you buy. >