Mail Archives: djgpp/1996/04/02/11:09:39
(Newbee question: sorry if its been asked a thousand times before...)
When compile the simple bit of code below using this command line:
gcc -lpc -Wall -pedantic junk.c -o junk
... I get this error message:
junk.c(.text+0xfd): undefined reference to 'getche'
As far as I am aware: 'getche' is in the libpc.a library and the -lpc switch
should instruct to linker (via the compiler) to search that library.
Is this a command line error, or is something wrong with my library? I am
fairly sure there is nothing wrong with my C program, but since I am new at
this I guess it is also a real possibility! Any help will be greatly
appreciated.
John
#include <stdio.h>
#include <conio.h>
void main(void);
void main(void)
{
int buffer;
char string[100];
char *ps;
ps=string;
do
{
buffer=getche();
ps++;
*ps=buffer;
}
while (buffer!='\n');
*string='\0';
}
----------------------------------------------------------------------
John Brown: jabrown AT unix DOT infoserve DOT net Lotus /\
List owner: Approach Users Mailing List /--\pproach
To subscribe: send "SUBSCRIBE APPROACH" relational database
to MAISER AT rmgate DOT pop DOT indiana DOT edu help & discussion
----------------------------------------------------------------------
- Raw text -