C++ Compiler Package Installs


#1

Alright so got a bit of an issue. I am attempting to install a C++ compiler, potentially something for Java as well, despite not really finding a compiler for Java right away. Well I installed a package for a C++ compiler, installed the package dependency and even installed MinGW, adding it to my PATH for windows 10.

Once that is all done, even on a simple Hello World program for C++ it kicks back saying something is missing or not set to the PATH. But I ensure you it is, without a doubt, set up to PATH. Normally I would just say I am doing something wrong. But I decided out of sheer curiosity, to install Atom on a school computer, in my CS lab. Installed the C++ compiler package (did not install MinGW as the dependency suggests) and hit compile and run. It ran, no issues. Now I imagine that is because the labs are already installed with C++ compilers with the PATH already setup for them in order to use the normal class IDE’s. But this begs the question what am I then doing wrong and how do I fix it.

Barring that is there anyone who can recommend a direct link to a package that allows for C++ compiling and potentially one for Java as well. Thank you ahead of time.


#2

I’m confused. Are you trying to run the compiler from the command line or from within Atom?

Have you opened a new command line since changing your PATH? Environment variables get loaded in when a shell is initialized and then they don’t change live when you update the variables stored in your system. You can check the variables for the active environment with the env command.

Barring that is there anyone who can recommend a direct link to a package that allows for C++ compiling and potentially one for Java as well.

There are a number of them. gpp-compiler, script, atom-runner, and process-palette can all accomplish it, and they do it by sending either the text of the file or the file itself to an external executable that knows what to do with the code.


#3

Thank you for the response. To answer you:

  1. I am attempting to compile from within Atom using a Package.
  2. I have not used command line at all at this point.
    3, The error I get upon running the gpp-compiler package to compile code that has been tested (the exact .cpp file) in another IDE:

‘g++’ could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

  1. MinGW was installed to the following path: C:\MinGW
  2. The PATH has been updated with: C:\MinGW\bin
  3. While, admittedly, I am unsure the exact means to use env in CMD to look at the PATH to see the active environment I am certain that the PATH does list using echo %PATH%.

Hope that details the issue more. Again thank you for the quick response.


#4

Please also forgive the complete failure at the formatting failure there.


#5

It would help to know the specific package, as well as what actions you’re taking. As a remote observer with no access to your machine, I need to be able to precisely model what’s going on on your end.

I have not used command line at all at this point.

This is an important step in the troubleshooting process, because it gives more information about where things are going wrong.

The PATH has been updated with: C:\MinGW\bin

Is there a file called g++.exe in there? If so, right click on it, select Properties, then Security and see if the permissions look normal (all groups or users should have the Read and Read & execute privileges).

While, admittedly, I am unsure the exact means to use env in CMD to look at the PATH to see the active environment I am certain that the PATH does list using echo %PATH%.

That also works. To use env, you just type it and it’ll dump a whole lot of information on you.

Again thank you for the quick response.

Work was really slow at the time. :smiley:


#6

The package as mentioned before is the gpp-compiler package. Though doing env does nothing as it is not a recognized command when used.

Taking a look at the actual file path there was only a single executable in the folder. It had no information related to g++ at all. Just for kicks I ran the software and found it was a package installer and that the actual compiler itself was not installed. I literally installed an installer rather then the compiler packages themselves. So I went through marked the compiler files to install, let them do their thing, tried to run a basic Hello World and it works just fine now. Kind of a duh moment for me.

I guess that is what I get for trusting an installer file to do the work. Thanks for the help!


#7

Damn. Maybe it’s a feature in clink. I use cmder (because cmd sucks) and it’s definitely not an alias.

I literally installed an installer rather then the compiler packages themselves.

Good to know.