Error 2 The system cannot find the file specified

2020-04-07 19:47发布

问题:

Just installed Sublime Text 2, try to build hello world program, and get this message:

[Error 2] The system cannot find the file specified
[cmd:  [u'g++', u'', u'-o', u'/']]
[dir:  C:\Windows\system32]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\]
[Finished]

What do I need to do to compile a program correctly in ST2?

回答1:

Solved. Sublime Text 2 needs g++, bash, etc in order to compile. These files (?) need to be installed in your computer, as per the instructions on this page:

http://www.claremontmckenna.edu/pages/faculty/alee/g++/g++.html

Make sure you save the file you're working on, where ever on your drive before building and running.