如何让minGW找到正确编译链接的路径

发布于 2024-11-29 08:07:50 字数 208 浏览 1 评论 0原文

我目前正在使用 Sams Teach myself C++ in 24 Hours 来参加大约一周后开始的计算机科学课程,它告诉我下载 minGW,然后将路径变量更改为 ;C: \MinGW\bin,我照做了,但随后当我尝试编译和链接它告诉我创建的“程序”时,它说没有这样的文件或目录。有谁知道为什么这样说或者如何解决?我什至将名为 motto.cpp 的文件放入 bin 文件中,但它仍然说找不到它。

I am currently using Sams Teach yourself C++ in 24 Hours for my computer science class that starts in about a week and it told me to download minGW and then change the path variable to ;C: \MinGW\bin, which I did, but then when I attempted to compile and link the "program" it told me to create, it says no such file or directory. Does anyone know why it is saying this or how it can be fixed? I even put the file which is named motto.cpp into the bin file and it is still saying that it cannot be found.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城月光淡如水﹏ 2024-12-06 08:07:50

您使用的是 Windows 7 吗?如果是这样,请尝试打开“开始”菜单,搜索“变量”并选择“编辑系统变量”,然后搜索底部的“环境变量...”按钮并按下。然后选择“用户变量”下的“新建...”,为其指定一个名称并放置该值的 C:\MinGW\Bin 路径。按两次“确定”并从命令行尝试。

我不确定您是否使用 DevCPP 或 CodeBlocks 等编译器 IDE,因此我假设您是从命令行执行此操作。如果这是编译器问题,请尝试编辑 include、bin 和 lib 的编译器设置。将它们指向 MinGW bin 的 bin 以及 include 的 include 等等...

Are you on Windows 7? If so, try opening Start Menu, searching for "Variables" and select "Edit System Variables" then search for the button at the bottom "Environment variables..." and push it. Then select "new..." under "User variables for ", assign it a name and put the C:\MinGW\Bin path for the value. Press "OK" twice and try it from command line.

I am unsure if you are using a compiler IDE such as DevCPP or CodeBlocks, so I am assuming you are doing this from command line. If this is a compiler issue, try editing the compiler settings for include, bin and lib. Point them to the MinGW bin for bin and include for include etc...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文