Pelles C forum

Pelles C => General discussions => Topic started by: Kenneth Bull on November 06, 2005, 12:40:18 AM

Title: conio.h
Post by: Kenneth Bull on November 06, 2005, 12:40:18 AM
a simple program:

#include <conio.h>

int main()
{
getch();
return 0;
}

gives the following error:

POLINK: error: Unresolved external symbol '_getch'.
POLINK: fatal error: 1 unresolved external(s).
*** Error code: 1 ***
Done.


The compiler works perfectly for any header and associated functions that I've tried, except conio.h.  Does anyone know what I might be missing?

Thank you.
Title: conio.h
Post by: Pelle on November 06, 2005, 02:58:38 PM
Either use _getch() (not getch)..., or use the compiler option /Go.

Pelle
Title: Thanks!!
Post by: Kenneth Bull on November 07, 2005, 08:14:08 AM
Quote from: "Pelle"Either use _getch() (not getch)..., or use the compiler option /Go.

Pelle

Works beautifully.  Might I ask why the _ is required with default options for conio, but not for other functions (like io functions related to stdio.h)?
Title: conio.h
Post by: Pelle on November 07, 2005, 11:07:47 PM
Functions that are not part of standard C (currently "C99") have names that start with an underscore...

Pelle