简体   繁体   English

MinGW编译器错误 - 如何设置MSYS bat?

[英]MinGW Compiler Errors - How do I setup the MSYS bat?

I'm running Windows 8 . 我正在运行Windows 8

I installed the MinGW compiler to the default C:\\ directory using the GUI installer . 我使用GUI安装程序将MinGW编译器安装到默认的C:\\目录中。 I selected to install all the elements available in the Basic Setup package of the MinGW Installation Manager . 我选择安装MinGW Installation ManagerBasic Setup软件包中的所有可用元素。

After the installation completed, I checked that "C:/MinGW/msys/1.0/etc/fstab" had the one line of C:/MinGW /mingw and an open line beneath it. 安装完成后,我检查了“C:/MinGW/msys/1.0/etc/fstab”有一行C:/MinGW /mingw ,下面是一条开放的行。 I also created a shortcut to msys.bat in the Start menu. 我还在“开始”菜单中创建了msys.bat的快捷方式。

Then I rebooted my machine. 然后我重新启动了我的机器。

I created a folder called "CompileBin" in the C:\\ directory, so C:\\CompileBin\\ and then I placed my test.cpp file inside, so C:\\CompileBin\\test.cpp 我在C:\\目录中创建了一个名为“CompileBin”的文件夹,所以C:\\CompileBin\\然后我把test.cpp文件放在里面,所以C:\\CompileBin\\test.cpp

I ran msys.bat and the console opened up. 我跑了msys.bat ,控制台打开了。 It showed: 这显示了:

MyName,@MyLaptopsName ~
$

I started to navigate to where my test.cpp is: 我开始导航到test.cpp所在的位置:

cd c:\CompileBin\

Now the prompt looked like this: 现在提示符如下所示:

MyName,@MyLaptopsName ~
$ cd c:\CompileBin\
>

I entered the dir command to look around and got the response: 我进入了dir命令环顾四周并得到了回复:

MyName,@MyLaptopsName ~
$ cd c:\CompileBin\
> dir
sh: cd: c:CompileBindir: No such file or directory

Okay, so I figured maybe the path wasn't set up. 好的,所以我想也许路径没有设置好。

I added PATH to the Environment Variables (because it was NOT originally there) and gave it the value C:\\MinGW\\bin; 我将PATH添加到环境变量中 (因为它原本不在那里)并给它赋值C:\\MinGW\\bin;

I still get the same error. 我仍然得到同样的错误。

Unix tooling requires forward slashes in path names. Unix工具需要路径名中的正斜杠。 It is cd c:/CompileBin 它是cd c:/CompileBin

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

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