www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000290

When Created: 06/20/1999 07:00:49
Against DJGPP version: 2.02
By whom: byrnes@rpi.edu
Abstract: Linker Error - Function lrand48( ) Missing
When calling the STL function random_shuffle (from <algorith> include file,)
received a linker error that function lrand48( ) was not defined. Search
of the DJGPP include files revealed that: 1) random_shuffle calls function
iter_swap, 2) iter_swap calls lrand48( ), & 3) lrand48( ) could not be
found.

I believe this is a DJGPP vs. GNU issue since I was able to use
random_shuffle with GCC 2.8.2 on a UNIX system.

As a workaround random_shuffle is overloaded to allow the user to
specify a custom random number generator. However, I do not know
if this is true of all algorithms that use a random number generator.

Note added: 06/21/1999 09:00:30
By whom: broeker@physik.rwth-aachen.de
[The following is out of memory, so it may not be
100% correct:]

This has been observed before. It was diagnosed as an error
in the building procedure of the STL, on DJGPP. The 'configure'
script thinks that lrand48() and drand48() are present, when, 
in reality, they aren't. The workaround seems to be to explicitly
change the results of one 'configure' test in config.cache, 
rerun configure and rebuild the STL (libstdc++, that is).

More about this should be findable in the mailing list archives.

Solution added: 06/23/1999 06:00:06
By whom: eliz@is.elta.co.il
The solution is to upgrade to v2.03 (when it's available), where
the rand48 family of functions were added.

Workaround added: 06/23/1999 06:00:01
By whom: eliz@is.elta.co.il
An easier workaround, that doesn't require to download the libstdc++
sources and rebuild everything, is to edit the file _G_config.h which
comes with gpp281b.zip (it is unzipped into the lang/cxx directory)
and add a line there saying thusly:

#define __STL_NO_DRAND48

Save _G_config.h, exit the editor, and the problem should go away.

Fixed in version on 06/23/1999 06:00:12
By whom: eliz@is.elta.co.il



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010