www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/28/21:22:06

From: Tudor <tudor AT cam DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Weird error(answer for Eli) (completed!)
Date: Thu, 28 Nov 1996 17:23:41 -0800
Organization: Communications Accesibles Montreal
Lines: 74
Message-ID: <329E3B1D.1D8C@cam.org>
References: <329E3334 DOT 4210 AT cam DOT org>
Reply-To: tudor AT cam DOT org
NNTP-Posting-Host: dynamicppp-195.hip.cam.org
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

soory.this is complete: 
 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);
 };                                                              _

int
main()                                                                    
{                                                                       
 long  int
i;                                                                
                                                                        
    if (_beginthread(mythread, NULL, 8192, NULL) == -1)
{                      puts("no
thread");                                                    
       
exit(1);                                                              
   
}                                                                         
   
delay(1000);                                                              
    return
0;                                                                 
}                                                                      
 *****************
 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