A compiler is a program specifically designed to translate a source code of the programming language into machine code and return human-readable output after executing the code. There are different compilers available for executing the C++ program. Turbo C++ is also a compiler used for the execution of C++ programs.
What Is Turbo C++ Error: Unable to Open Include File ‘STDIO.H’ and How Does It Arise?
Compilers can display different errors while executing the code, in case of defective codes. The “Unable to Open Include File ‘STDIO.H’” is a compilation error often seen in the Turbo C++ compiler during the compilation of a code. This error mainly arises due to the wrong configuration in the directories of Turbo C++.
How to Resolve Turbo C++ Error: Unable to Open Include File ‘STDIO.H’
This is a program written to display the shape of a circle.
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int radius = 100;
initgraph(&gdriver, &gmode, "C:\\turboc3\\bgi");
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
circle(midx, midy, radius);
getch();
closegraph();
return 0;
}
When this code is executed in Turbo C++ it returns an error including Unable to Open Include File ‘STDIO.H’. This error occurs during the compilation of the code due to the wrong configuration of directories:
To fix this error, follow the steps given below:
Step 1: Select Options from the Turbo C++ window. Go to Applications:
Step 2: Click on library. Choose Standard from the pop-up window and hit OK:
Step 3: Go to Options again, choose Directories and configure Directories as demonstrated below, and click OK:
Step 4: Now click on Compile again and wait until the compilation is completed. The compilation is successful, and the error is fixed:
Conclusion
This error is a compilation error often seen in the Turbo C++ compiler during the compilation of code. This error mainly arises due to the wrong configuration in the directories of Turbo C++. This error can be fixed by configuring the directories of the Turbo C++ properly.