NO

Author Topic: conio.h  (Read 3564 times)

Kenneth Bull

  • Guest
conio.h
« 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.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
conio.h
« Reply #1 on: November 06, 2005, 02:58:38 PM »
Either use _getch() (not getch)..., or use the compiler option /Go.

Pelle
/Pelle

Kenneth Bull

  • Guest
Thanks!!
« Reply #2 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)?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
conio.h
« Reply #3 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
/Pelle