delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/01/18/11:09:38

From: dkarnes AT mystech DOT com (Derek Karnes)
Subject: Re: random(), srandom()
18 Jan 1998 11:09:38 -0800 :
Message-ID: <34BF75B7.F13DF5AA.cygnus.gnu-win32@mystech.com>
References: <9801130530 DOT aa23801 AT soldist DOT arl DOT mil>
Mime-Version: 1.0
To: Andrew Neiderer <neiderer AT arl DOT mil>
Cc: gnu-win32 AT cygnus DOT com

Stick these two lines in one of your included header files:
#define random   rand
#define srandom  srand

and this in the file where the functions are being used:
#include <stdlib.h>
which is \gnuwin32\b18\H-i386-cygwin32\i386-cygwin32\include\stdlib.h (which
has rand() and srand())

Should work.

-D

Andrew Neiderer wrote:

> I have an OpenGL program that uses srandom(), random()
> for fractal terrain generation.  I thought the prototypes
> would be in H-i386-cygwin32/i386-cygwin32/include/math.h
> but they are not.  Does anyone know how to handle the
> errors "undefined references ..." to these 2 routines when
> I try to generate the executeable.  Thanks.
>
> - Andy Neiderer
>   neiderer AT arl DOT mil



--
--------------------------------
--      Derek L. Karnes       --
--    dkarnes AT mystech DOT com     --
-- http://www.erols.com/terek --
--------------------------------


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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