C语言 如何修复“无法在 Turbo C 中打开 stdio.h”错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2356687/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to fix "unable to open stdio.h in Turbo C" error?
提问by aditya
Whenever I compile my program, I get the error above.
每当我编译我的程序时,都会出现上面的错误。
回答by Amit
If you have problems like that, first of all your TCfolder 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..
如果您遇到这样的问题,首先将您的TC文件夹放入 C:... 驱动器。安装完成后打开turbo c蓝屏。有一个OPTIONS > Directories.. 你可以看到设置路径的选项..
- include directories..you can set path there now..
C:\TC\INCUDE - libraries Directories..you can set path there...
C:\TC\LIB - 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..
- 包括目录..你现在可以在那里设置路径..
C:\TC\INCUDE - 图书馆目录..你可以在那里设置路径......
C:\TC\LIB - 如果要将输出存储在 BIN 中,则可以设置.. ..
C:\TC\BIN否则,您可以设置要存储输出的另一个路径..
Finally you can give OKand finished processes.. It will now work properly
最后你可以给出OK和完成的过程..它现在可以正常工作了
回答by Arya kumar
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.
这样做:打开里面有 tc.exe 文件的 turboc2 文件夹,在这个文件旁边,你会发现另一个名为“tcinst.exe”的文件打开它。
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.
在这里,您必须将目录的路径更改为您的 INCLUDE 文件夹所在的路径。同样的方式更改库目录的路径也重新启动您的 tc.exe。
回答by Arun
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:
检查INCLUDE文件夹和LIB文件夹下是否有类似stdio.h文件和其他头文件的东西。LIB 包含一些文件。就我而言,我遇到了同样的问题,但是这两个文件夹都是空白的……很高兴知道。脚步:
- Press: ALT + O + D (i.e. press ATL (keep pressed) and then O english character) and then D).
- You'll see a popup window.
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:
Press ALT + C.
- Set your current directory as C:\TC\BGI
- Press ALT + O + D, and put ../INCLUDE and ../LIB in Include/Lib directory values.
- 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.
- 按:ALT + O + D(即按ATL(按住不放)然后O 英文字符)然后D)。
- 你会看到一个弹出窗口。
此窗口将包含 INCLUDE 和 LIB 目录的值。弹出窗口中这两个框的默认值是: 安装 TC 的驱动器号...即 C:\ 或 D:\ 或后面跟 INCLUDE 和 LIB 文件夹路径的任何内容。所以,就我而言,
INCLUDE 框设置为:“C:\TC\INCLUDE”,LIB 目录值框设置为:“C:\TC\LIB”(不带引号)。解决步骤:
按 ALT + C。
- 将当前目录设置为 C:\TC\BGI
- 按 ALT + O + D,并将 ../INCLUDE 和 ../LIB 放在 Include/Lib 目录值中。
- 现在......当你开始进步时,你会感谢我。我喜欢我现在在 DOS Turbo C 上运行的 Archduchess C 分形图形。哈哈。
回答by Abhishek
Go to OPTIONS tab then select directories option then enter the particular path where your turbo c folder exists.
转到选项选项卡,然后选择目录选项,然后输入 turbo c 文件夹所在的特定路径。
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.
在所有四个消息框中输入路径,它就会像我的情况一样开始工作。我有 TurboC3,所有文件都放在一个公共根文件夹中。
回答by backwardzfast
Well, I've been working backshift just spent about 6 hours trying to figure this out.
好吧,我一直在倒班工作,只是花了大约 6 个小时试图解决这个问题。
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.
以上所有信息都导致了这个结论,并且在 dos 提示屏幕中只有一行,当我退出编辑器时,转到 dos 提示我的 C: 驱动器已安装。
I did a dirsearch and what I found was: the way in which I had mounted the C drive initially looked like this
我进行了dir搜索,发现的是:我最初安装 C 驱动器的方式看起来像这样
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 驱动器上的所有文件,只列出 turboc++ 文件夹中的文件。由此我得出结论,我的目录应该如下所示:
c:\include
c:\include
not
不是
c:\turboc++\tc\include
c:\turboc++\tc\include
or
或者
c:\tc\include
c:\tc\include
The real problem was the nature in which I had mounted the drive.
真正的问题是我安装驱动器的性质。
Hope this helps someone.
希望这可以帮助某人。
b.mac
mac
回答by Shaihi
Check your environment include path. The file is not in the locations pointed by that environment variable.
检查您的环境包括路径。该文件不在该环境变量指向的位置。
回答by t0mm13b
Since you did not mention which version of Turbo C this method below will cover both v2 and v3.
由于您没有提及 Turbo C 的哪个版本,因此下面的方法将涵盖 v2 和 v3。
- Click on 'Options', 'Directories', enter the proper location for the Include and Lib directories.
- 单击“选项”、“目录”,为 Include 和 Lib 目录输入正确的位置。
回答by Dharani
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 Cinstead of FSo from OPTION>DIRECTORYchange the folder name
首先检查文件夹名称是对还是错,因为当您从另一个文件夹复制到一个文件夹时,它会意外地获取其他文件夹地址,例如它需要C而不是F因此OPTION>DIRECTORY更改文件夹名称
回答by Jonathan Leffler
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).
在大多数系统上,您必须非常努力地尝试不找到“ <stdio.h>”,以至于第一反应是“已<stdio.h>安装”。所以,我想看看文件是否存在于一个合理的位置。如果没有,那么您的 Turbo C 安装已损坏;重新安装。如果你能找到它,那么你必须确定为什么编译器没有在正确的位置搜索它 - 你指定的编译器选项是什么,编译器在哪里搜索它的头文件(为什么不是搜索标题所在的位置)。
回答by zooropa
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.
我不知道这在 Turbo C 中的位置,但我认为有一种方法可以做到这一点。

