Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] 'g++' could not be spawned #14

Closed
toadicus opened this issue Apr 18, 2016 · 8 comments
Closed

[Windows] 'g++' could not be spawned #14

toadicus opened this issue Apr 18, 2016 · 8 comments

Comments

@toadicus
Copy link

I have installed g++ via mingw and have C:\MinGW\bin in my PATH, but atom cannot spawn g++. The error said to open an issue, so here it is!

Directory listing showing g++ is there:

>dir c:\MinGW\bin\g++.exe
 Volume in drive C is OS
 Volume Serial Number is 4EAF-EDC5

 Directory of c:\MinGW\bin

07/25/2015  06:32 AM           903,694 g++.exe

PATH showing C:\MinGW\bin is in PATH:

>echo %PATH%
C:\ProgramData\Oracle\Java\javapath;C:\PROGRAM FILES\DELL\DW WLAN CARD\DRIVER;C:\PROGRAM FILES (X86)\NVIDIA CORPORATION\PHYSX\COMMON;C:\PROGRAM FILES (X86)\INTEL\ICLS CLIENT\;C:\PROGRAM FILES\INTEL\ICLS CLIENT\;C:\WINDOWS\SYSTEM32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\PROGRAM FILES (X86)\SECURITY INNOVATION\SI TSS\BIN\;C:\PROGRAM FILES (X86)\WINDOWS LIVE\SHARED;C:\WINDOWS\SYSTEM32\WINDOWS SYSTEM RESOURCE MANAGER\BIN;C:\PROGRAM FILES\COMMON FILES\AUTODESK SHARED\;C:\PROGRAM FILES (X86)\TESSERACT-OCR;C:\PROGRAM FILES (X86)\GTKSHARP\2.12\BIN;C:\PROGRAM FILES (X86)\INTEL\OPENCL SDK\2.0\BIN\X86;C:\PROGRAM FILES (X86)\INTEL\OPENCL SDK\2.0\BIN\X64;C:\WINDOWS\IDMU\COMMON;C:\PROGRAM FILES\MICROSOFT SQL SERVER\110\TOOLS\BINN\;C:\PROGRAM FILES\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\DAL;C:\PROGRAM FILES\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\IPT;C:\PROGRAM FILES (X86)\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\DAL;C:\PROGRAM FILES (X86)\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\IPT;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\QT Lite\QTSystem;C:\Program Files (x86)\Common Files\Trane Company\;C:\Program Files\Windows Imaging\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Users\------\bin;D:\------\ws\android_sdk\sdk\platform-tools;C:\Program Files\Mercurial;C:\Users\------\AppData\Local\atom\bin;C:\MinGW\bin

Using gpp-compiler version 2.1.0.

TIA!

@kriscross07
Copy link
Owner

Open command prompt and enter g++ --version and paste the output.

@toadicus
Copy link
Author

>g++ --version
g++ (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@kriscross07
Copy link
Owner

In Atom, press Ctrl + Alt + i (I think it's that in Windows, it's Ctrl + Shift + i on Linux) and click on the Console tab, and paste require("child_process").spawn("g++", ["--version"]).stdout.on("data", (data) => {console.log(data.toString());});, then enter require("child_process").exec("g++ --version").stdout.on("data", (data) => {console.log(data.toString());});.
What do those output?

@toadicus
Copy link
Author

require("child_process").spawn("g++", ["--version"]).stdout.on("data", (data) => { console.log(data.toString());});
Socket {_connecting: false, _hadError: false, _handle: Pipe, _parent: null, _host: null…}
events.js:141 Uncaught Error: spawn g++ ENOENTexports._errnoException @ util.js:856ChildProcess._handle.onexit @ internal/child_process.js:178onErrorNT @ internal/child_process.js:344doNTCallback2 @ node.js:465_tickCallback @ node.js:379
require("child_process").exec("g++ --version").stdout.on("data", (data) => {console.log(data.toString());});
Socket {_connecting: false, _hadError: false, _handle: Pipe, _parent: null, _host: null…}

@kriscross07
Copy link
Owner

This seems like an issue with Node.js. What happens if you move C:\MinGW\bin to the beginning of %PATH%?

@toadicus
Copy link
Author

Moving the path to the beginning had no effect. Though, I had to do that from the command line (Windows' normal tools don't let you do that) and I don't actually know if that applied to the atom process when I ran it. I did launch it from the same command window, but who knows.

@toadicus
Copy link
Author

So, I think I may have found the issue, but I'm perplexed as to how to resolve it. In the atom console, I printed the path and got this:

> process.env.PATH
< "C:\Python35;;/usr/local/bin;/usr/bin;/bin;/usr/sbin;/sbin"

@toadicus
Copy link
Author

I may have resolved the issue by completely uninstalling atom, deleting all of its leftovers, and reinstalling. Closing this for now; thanks for the support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants