public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* random(), srandom()
@ 1998-01-13  2:37 Andrew Neiderer
  1998-01-16 18:15 ` Derek Karnes
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Neiderer @ 1998-01-13  2:37 UTC (permalink / raw)
  To: gnu-win32; +Cc: neiderer

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@arl.mil
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: random(), srandom()
  1998-01-13  2:37 random(), srandom() Andrew Neiderer
@ 1998-01-16 18:15 ` Derek Karnes
  0 siblings, 0 replies; 2+ messages in thread
From: Derek Karnes @ 1998-01-16 18:15 UTC (permalink / raw)
  To: Andrew Neiderer; +Cc: gnu-win32

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@arl.mil



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


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-01-16 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-13  2:37 random(), srandom() Andrew Neiderer
1998-01-16 18:15 ` Derek Karnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).