[c] How to fix "unable to open stdio.h in Turbo C" error?

Whenever I compile my program, I get the error above.

This question is related to c compiler-errors header-files turbo-c

The answer is


Do this: Open your turboc2 folder you have tc.exe file inside, beside this file you find another file as named as ' tcinst.exe ' open it.

You will see the installation menu:

select as-- > Option > Directory > Include directory

Here you have to change the path of the directory to the path where your INCLUDE folder is located. Same way change the path to library directory also over restart your tc.exe.


Check if you have anything like those stdio.h file and other header files under INCLUDE folder and LIB folder. LIB contains some files. In my case, I had the same issue but both of these folder were blank.. good to know. Steps:

  1. Press: ALT + O + D (i.e. press ATL (keep pressed) and then O english character) and then D).
  2. You'll see a popup window.
  3. This window will have values for INCLUDE and LIB directories. The by default value for these two boxes in the popup window are: Drive leter where you installed TC... i.e. C:\ or D:\ or whatever followed by the path for INCLUDE and LIB folder. So, in my case,

    INCLUDE box was set to: "C:\TC\INCLUDE" and LIB directory value box was set to: "C:\TC\LIB" (without quotes). Steps to resolve:

  4. Press ALT + C.

  5. Set your current directory as C:\TC\BGI
  6. Press ALT + O + D, and put ../INCLUDE and ../LIB in Include/Lib directory values.
  7. and now... when you'll run your progress, you'll say thanks to me. I like the archduchess C fractal graphics that I'm running on DOS Turbo C right now. Lol.

If you have problems like that, first of all your TC folder put in to the C:..drive. after completing installation open turbo c blue screen. there is a OPTIONS > Directories ..in that you can see for option to set up path..

  1. include directories..you can set path there now.. C:\TC\INCUDE
  2. libraries Directories..you can set path there...C:\TC\LIB
  3. if you want to store your output in BIN then you can set..C:\TC\BIN..otherwise you can set another path where you want to store your output..

Finally you can give OK and finished processes.. It will now work properly


Well, I've been working backshift just spent about 6 hours trying to figure this out.

All of the above information led to this conclusion along with a single line in dos prompt screen, when I exited the editor, go to the dos prompt my C: drive is mounted.

I did a dir search and what I found was: the way in which I had mounted the C drive initially looked like this

mount c: /

and my dir did not list all files on the C drive only files within the turboc++ folder. From that I had drawn the conclusion that my directories should look like:

c:\include

not

c:\turboc++\tc\include

or

c:\tc\include

The real problem was the nature in which I had mounted the drive.

Hope this helps someone.

b.mac


Since you did not mention which version of Turbo C this method below will cover both v2 and v3.

  • Click on 'Options', 'Directories', enter the proper location for the Include and Lib directories.

Make sure the folder with the standard header files is in the projects path.

I don't know where this is in Turbo C, but I would think there's a way of doing this.


On most systems, you'd have to be trying fairly hard not to find '<stdio.h>', to the point where the first reaction is "is <stdio.h> installed". So, I'd be looking to see if the file exists in a plausible location. If not, then your installation of Turbo C is broken; reinstall. If you can find it, then you will have to establish why the compiler is not searching for it in the right place - what are the compiler options you've specified and where is the compiler searching for its headers (and why isn't it searching where the header is).


Check your environment include path. The file is not in the locations pointed by that environment variable.


First check whether the folder name is right or wrong since while you copying to one folder from other accidently it takes other folder address eg it take C instead of F So from OPTION>DIRECTORY change the folder name


Just Re install the turbo C++ from your Computer and install again in the Directory C:\TC\ Folder.

Again The Problem exists ,then change the directory from FILE>>CHANGE DIRECTORY to C:\TC\BIN\


Go to OPTIONS tab then select directories option then enter the particular path where your turbo c folder exists.

Enter the path in all the four message boxes and it would start working like it did in my case. I have TurboC3 and all the files were together in one common root folder.


Examples related to c

conflicting types for 'outchar' Can't compile C program on a Mac after upgrade to Mojave Program to find largest and second largest number in array Prime numbers between 1 to 100 in C Programming Language In c, in bool, true == 1 and false == 0? How I can print to stderr in C? Visual Studio Code includePath "error: assignment to expression with array type error" when I assign a struct field (C) Compiling an application for use in highly radioactive environments How can you print multiple variables inside a string using printf?

Examples related to compiler-errors

intellij idea - Error: java: invalid source release 1.9 Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug' Deserialize JSON with Jackson into Polymorphic Types - A Complete Example is giving me a compile error Android java.exe finished with non-zero exit value 1 error: expected primary-expression before ')' token (C) What does "collect2: error: ld returned 1 exit status" mean? Python3: ImportError: No module named '_ctypes' when using Value from module multiprocessing Maven error :Perhaps you are running on a JRE rather than a JDK? What does a "Cannot find symbol" or "Cannot resolve symbol" error mean? Operator overloading ==, !=, Equals

Examples related to header-files

How to make g++ search for header files in a specific directory? Where to find the complete definition of off_t type? Where is the <conio.h> header file on Linux? Why can't I find <conio.h>? .c vs .cc vs. .cpp vs .hpp vs .h vs .cxx How do I include the string header? error C2039: 'string' : is not a member of 'std', header file problem How can I create C header files C++, how to declare a struct in a header file Makefile, header dependencies How to fix "unable to open stdio.h in Turbo C" error?

Examples related to turbo-c

How to fix "unable to open stdio.h in Turbo C" error?