windows bin 目录和 PATH

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3224606/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:26:08  来源:igfitidea点击:

bin directory and PATH

windowspath

提问by wantSTUDY

I'm beginner in programming. Can somebody please explain (by simple words) what do I have inside the bin directory of program?

我是编程初学者。有人可以(用简单的话)解释一下我在程序的 bin 目录中有什么吗?

What is this PATHenvironment variable of windows, how does it work (please don't think that I don't know how to use Google, I just want to understand it more clearly)?

PATHwindows的这个环境变量是什么,它是如何工作的(请不要以为我不会使用Google,我只是想更清楚地了解它)?

回答by ChrisF

You usually put all the binary files for a program in the bin directory. This would be the executable itself and any dlls (dynamic link libraries) that the program uses.

您通常将程序的所有二进制文件放在 bin 目录中。这将是可执行文件本身和程序使用的任何 dll(动态链接库)。

This isn't essential as Windows use the PATH environment variable to look for dlls your program needs. This is a list of folders that Windows searches, in order, when it can't find a dll (say) in the current directory.

这不是必需的,因为 Windows 使用 PATH 环境变量来查找您的程序需要的 dll。这是当 Windows 在当前目录中找不到 dll(例如)时按顺序搜索的文件夹列表。

So if you want to have a dll used by more than one program you could put it in a location already on the PATH or add a new folder to the PATH.

因此,如果您想让一个 dll 被多个程序使用,您可以将它放在 PATH 上已经存在的位置,或者向 PATH 添加一个新文件夹。