简体   繁体   English

在窗口中包括C的基本库(unistd.h)

[英]Including basics library of C (unistd.h) on window

I've been programming at my school on a Mac for one month. 我在学校的Mac上编程已经有一个月了。 We did C programming on an UNIX shell. 我们在UNIX shell上进行了C编程。

Now i'm back at home and I use my own PC that is on window 10. I have tried to make a similar set up, but i don't know much about all that. 现在我回到家里,使用位于窗口10上的自己的PC。我试图进行类似的设置,但是我对此并不了解。 I installed git and bash, this made it like a UNIX shell. 我安装了git和bash,这使其像UNIX shell。 Also I have installed the gcc compiler. 另外,我已经安装了gcc编译器。

So, now that i'm making a basic program, it should be working but when I make the include <unistd.h> , the shell can't find it. 因此,既然我正在制作一个基本程序,它应该可以正常工作,但是当我制作include <unistd.h> ,shell找不到它。

I know my question is probably silly but I really couldn't find how to solve the problem. 我知道我的问题可能很愚蠢,但我真的找不到解决问题的方法。 I downloaded the unistd.h file. 我下载了unistd.h文件。

I also found this http://processors.wiki.ti.com/index.php/Compiler/diagnostic_messages/5 我还发现了这个http://processors.wiki.ti.com/index.php/Compiler/diagnostic_messages/5

It explain that i should be putting the .h folder in some kind of defined path, but I don't know how to do that. 它说明我应该将.h文件夹放在某种已定义的路径中,但是我不知道该怎么做。

Does anyone know how I can fix this? 有谁知道我该如何解决?

If you installed gcc as part of mingw or something similar, it should have included a unistd.h. 如果您将gcc安装为mingw或类似工具的一部分,则应包含unistd.h。 Just having the gcc compiler is not likely to get you very far. 仅使用gcc编译器可能不会使您走得太远。

You probably want to start over and install something different than you did ( mingw or cygwin or just set up a vm as suggested) that provides a more complete environment. 您可能想要重新开始并安装与您所执行的操作不同的操作( mingwcygwin或根据建议设置虚拟机),以提供更完整的环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM