www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/28/20:52:27

From: Tudor <tudor AT cam DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Weird error(answer for Eli)
Date: Thu, 28 Nov 1996 16:49:56 -0800
Organization: Communications Accesibles Montreal
Lines: 56
Message-ID: <329E3334.4210@cam.org>
Reply-To: tudor AT cam DOT org
NNTP-Posting-Host: dynamicppp-200.hip.cam.org
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli wrote:
**
Please post the shortest program which exhibits the above problem, the
*exact* command line you used to invoke gcc, and the *exact* text of the
error message(s) you get.  `delay' is in the library, so this message
shouldn't appear. 
**
I was asked to post a short program describing a weird error i'm
getting.
I'm using delay() in a program and it reports "undefined reference to
'delay' "

this is the file:
*****************
#include <dos.h>                                                       
#include <stdio.h>                           
#include <stdlib.h>                                                     
#include <process.h>                                                    
#include <conio.h>                                                     
#ifndef __MT__                                                         
#error You forgot to define -Zmt                                       
#endif                                                                                                                                          
int global;                                                             
                                                                        
void mythread (void
*param)                                                   
{                                                                       
char
c;                                                                       
while (1)                                                               
{
if(c=getch()=='q') 
{
puts("Quitting");
printf(" %i ",global);
exit(0);
};
global++;                                                               
fflush(stdout);
};                                                              _
};                                                                      
*****************
This is the command line:

D:\DJGPP\RSXNTDJ\SAMPLE\CONSOLE\THREAD>gxx -Zwin32 -Zmt thread.c

and the error message:

thread.c(.text+0xd6): undefined reference to `delay'

Now, I tried some different stuff:
I looked in the makefile and there is no other lib to link.
I searched all the libs containing the word delay(like libc.a etc)
and tried linking them manually but it didn't work.
What should I do?
tudor 'at' cam 'dot' org

- Raw text -


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