www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/07/17:31:17

From: Mark Hull-Richter <mhr AT sparc DOT SanDiegoCA DOT ATTGIS DOT COM>
Subject: Problems with (first compile under) djgpp/gcc
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Tue, 7 Feb 1995 08:49:17 -0800 (PST)

I have a program of some 7000 lines that I have successfully compiled and run
on four Unix platforms and would like to have run on my PC.  I gave up on
Turbo C and Borland C++ because they gave me just too many problems that did
not seem to be related to the code itself (minor things like different include
paths, sizeof(char) == 0, j += k fails, etc).  So I turnedto djgpp.

However, although all nine files compile ok, the link at the end (final gcc
call) fails because of a series of errors that look like this:

lh-dice.c(.text+0x12c): undefined reference to `srand48'
lh-dice.c(.text+0x141): undefined reference to `lrand48'
lh-dice.c(.text+0x18f): undefined reference to `lrand48'
lh-dice.c(.text+0x23a): undefined reference to `lrand48'
lh-dice.c(.text+0x24e): undefined reference to `lrand48'
lh-dice.c(.text+0x2bf): undefined reference to `lrand48'
lh-dice.c(.text+0x329): more undefined references to `lrand48' follow
make.exe: *** [lh] Error 1

lh-dice.c is a generic "dice roller" module that uses srand48 to initialize
the random number generator and lrand48 to generate the random numbers it
turns into dice rolls.  It includes <stdlib.h> up front, and in looking
through the supplied (djgpp) stdlib.h, I find it includes djgppstd.h, which
contains the indicated function declarations.

What's wrong?

I have djgpp installed on my f: drive under f:\gcc.  My path includes
f:\gcc\bin (at the end) and I run `f:\gcc\bin\setdjgpp f:\gcc f:/gcc' as a
prelude to running `make' on the makefile.  The only difference between the PC
makefile and my unix makefile is that the target `lh' has the "-o lh" before
the modules list instead of after it.  There are no other "make.exe" files in
the path before the gcc make.

-- 
 ++==     AT&T   Mark A. Hull-Richter, Consulting Engineer  (310)524-5782 voice
+GIr==   Global  Teradata Decision Enabling Systems Center   427-5782 VoicePlus
=++=== Information  100 North Sepulveda Boulevard, #17-259  (310)524-5517 FAX
 ====   Solutions   El Segundo, CA  90245       mhr AT sparc DOT SanDiegoCA DOT ATTGIS DOT com

- Raw text -


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