Mail Archives: djgpp/1996/11/28/21:22:06
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 -