简体   繁体   中英

How to run c++ in atom with the atom script package?

I have a windows 10 computer with atom version 1.52.0 and g++ (MinGW.org GCC Build-2) 9.2.0. I can run c++ programs in Atom with the gpp-compiler, but I don't like how the program output is in a new window rather than at the bottom of the Atom window. I'm trying to set up c++ with the script package, but when I run the program with the script package I get the following error.

g++: error: /mnt/c/Users/user/Documents/USACO/2015-2016/December/Silver/test.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.

I can run java programs with the script package btw. screenshot

A bit late to reply. But for those to come here from Google, on the script package page , it clearly says:

+---------+------------+-----------------+------------------+--------------------+---------------------------------------------------------+
| Grammer | File Based | Selection Based | Required Package |  Required in PATH  |                          Notes                          |
+---------+------------+-----------------+------------------+--------------------+---------------------------------------------------------+
| C++     | Yes        | Yes             |                  | xcrun clang++/g++  | Available only on macOS and Linux. Run with -std=c++14. |
+---------+------------+-----------------+------------------+--------------------+---------------------------------------------------------+

Available only on macOS and Linux . Run with -std=c++14 .

So, it seems it's not available for Windows. Instead, you can use another package called gpp-compiler : https://atom.io/packages/gpp-compiler

It works fine on windows:

You'll need to install MinGW and add it to your PATH .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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