[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More newbie questions (problems with drand48)
From: |
Joseph E. Villa |
Subject: |
More newbie questions (problems with drand48) |
Date: |
Fri, 22 Jan 1999 16:55:15 -0800 |
Greetings,
I've got swarm-1.3.1 running on a NT4.0 machine under Cygwin19. I'm
trying to work my way through Benedikt Stefansson's Swarm Tutorial. I'm
wedged on the first example (SimpleCBug) and thought that I would see if
anyone had thoughts or coaching.
I've installed Cygwin in c:\Cygnus and swarm in c:\Swarm-1.3.1. I've
copied the text of main.m verbatim. I've copied the content of makefile
and modified as follows:
++++ begin ++++
SWARMHOME=c:\swarm-1.3.1
APPLICATION=bug
OBJECTS= main.o
include $(SWARMHOME)\packages\swarm\etc\swarm\makefile.appl
main.o: main.m
++++ end ++++
The main.m file includes the following snippet:
++++ begin ++++
random_move() {
double randnum;
randnum = drand48();
if (randnum <= 0.33333) return -1;
else if (randnum <= 0.6667) return 0;
else return 1;
}
++++ end ++++
When I enter make, I get the following:
++++ begin ++++
/Swarm-1.3.1/packages/swarm/bin/libtool-swarm --mode link gcc -g -O2
-fno-inline -L/Swarm-1.3.1/packages/swarm/lib
-Wl,-rpath,/Swarm-1.3.1/packages/swarm/lib
-L/Swarm-1.3.1/packages/BLT/lib -L/Cygnus/B19/H-i386-cygwin32/lib
-L/Cygnus/B19/H-i386-cygwin32/lib -L/Swarm-1.3.1/packages/libffi/lib
-L/Swarm-1.3.1/packages/png/lib -L/Swarm-1.3.1/packages/zlib/lib -o
bug.exe main.o -lspace -lanalysis -lsimtools -lsimtoolsgui -ltkobjc
-ltclobjc -lactivity -lrandom -lobjectbase -lcollections -ldefobj -lmisc
-lBLT80 -ltk80 -ltcl80 -lpng -lz -lffi -luser32 -lgdi32 -lm -lobjc
gcc -g -O2 -fno-inline -L/Swarm-1.3.1/packages/swarm/lib
-Wl,-rpath,/Swarm-1.3.1/packages/swarm/lib
-L/Swarm-1.3.1/packages/BLT/lib -L/Cygnus/B19/H-i386-cygwin32/lib
-L/Cygnus/B19/H-i386-cygwin32/lib -L/Swarm-1.3.1/packages/libffi/lib
-L/Swarm-1.3.1/packages/png/lib -L/Swarm-1.3.1/packages/zlib/lib -o
bug.exe main.o -lspace -lanalysis -lsimtools -lsimtoolsgui -ltkobjc
-ltclobjc -lactivity -lrandom -lobjectbase -lcollections -ldefobj -lmisc
-lBLT80 -ltk80 -ltcl80 -lpng -lz -lffi -luser32 -lgdi32 -lm -lobjc
main.o: In function 'random_move':
/Swarm-1.3.1/main.m:48: undefined reference to 'drand48'
make: *** [bug.exe] Error 1
++++ end ++++
I don't know that all the first jibberish is. But the second part is, I
infer, not good. And, of course, there is no bug.exe. My assumption had
been that drand48 was a function that was defined in either <simtools.h>
(imported) or <stdlib.h> (included). When I examine these, however, I do
not find drand48.
Does anyone, perchance, have any thoughts on the nature of my problem or
failure?
Cheers,
Joseph Villa
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- More newbie questions (problems with drand48),
Joseph E. Villa <=