windows 使 mingw 出现问题

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

make problem with mingw

windowspathmakefilemingw

提问by ThR37

I have a small problem with make and mingw. I usually use Linux and I am not really familiar with windows way of doing.

我对 make 和 mingw 有一个小问题。我通常使用 Linux,我不太熟悉 Windows 的工作方式。

C:\MingGW\binis in my path (I can launch directly g++ or sh by the windows command line) but when I try to type makeI have the following error :

C:\MingGW\bin在我的路径中(我可以通过 Windows 命令行直接启动 g++ 或 sh)但是当我尝试输入时make出现以下错误:

make: g++: command not found

I do not know which makeis use (no makein C:\MinGw\bin) and I do not know the equivalent of which in windows. Do I have forgotten an essential step ?

我不知道哪个make是使用(没有makein C:\MinGw\bin),我也不知道在 Windows 中哪个是等价的。我忘记了一个重要的步骤吗?

Thanks for your help.

谢谢你的帮助。

采纳答案by paxdiablo

Use this command to find out which one you're running:

使用此命令找出您正在运行的命令:

for %i in (make.exe) do @echo. %~$PATH:i

It's basically the equivalent of whichfor Windows, assuming you know the extension. If you want a script that will check all extensions, you can find it here.

which假设您知道扩展名,它基本上相当于Windows。如果您想要一个可以检查所有扩展名的脚本,您可以在此处找到它。



As pointed out in a comment by Chris, latter versions of Windows (Vista, 2003 Server, and Win7, I think) actually have a real equivalent called where, which may be better. Those of us still stuck back on XP can use the command above (or the big script at the other end of that link).

正如 Chris 在评论中指出的那样,Windows 的后期版本(我认为是 Vista、2003 Server 和 Win7)实际上有一个真正的等效项,称为where,这可能更好。我们这些仍然坚持使用 XP 的人可以使用上面的命令(或该链接另一端的大脚本)。

回答by Tim ?as

Try mingw32-make instead.

尝试 mingw32-make 代替。

回答by Sushant Choudhary

Are you sure there is no make ? Once do "where make" to confirm this and check the entries you get under C:\mingW\bin. Hopefully you will get a entry mingw-32-make.exe or something like that.

你确定没有 make 吗?一旦执行“where make”以确认这一点并检查您在 C:\mingW\bin 下获得的条目。希望你会得到一个条目 mingw-32-make.exe 或类似的东西。

All you need to do is rename (better create a copy and rename) this exe as make.exe and if you have already added the environment variable of this path then you may now be able to issue make command happily under mingw.

您需要做的就是将这个exe重命名(最好创建一个副本并重命名)为make.exe,如果您已经添加了该路径的环境变量,那么您现在可以在mingw下愉快地发出make命令。

The same is already done for g++,gcc, etc. They might have conveniently left make the way it is. Hope this helps

g++、gcc 等已经做了同样的事情。他们可能已经很方便地离开了原样。希望这可以帮助