Date: Tue, 2 Apr 1996 19:14:37 -0300 From: Cesar Scarpini Rabak Subject: Re: ERROR MSG: junk.c(.text+0xfd): undefined reference to 'getche' To: John Brown cc: djgpp AT delorie DOT com In-Reply-To: <199604021626.IAA17080@unix.infoserve.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 2 Apr 1996, John Brown wrote: > > (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. > Is a command line error! You should place the "-lpc" switch at the tail of the command line. Full details in the INFO docs.