Comments (20)
Hello. I'm gonna upload a guide for Windows users today because it seems a large number of users have this problem.
What you need to do is:
- Set the linter-gcc executable path to
g++.exe
orgcc.exe
- Add your MinGW bin to the system path by following the instructions here. Note that you need to add the MinGW bin path to the end. So if your PATH variable reads
C:\Windows\
, and your MinGW bin path isC:\MinGW\bin
, your new PATH variable should readC:\Windows\;C:\MinGW\bin
. Note the use of the semicolon separator.
Once you have made this change, linter-gcc should work.
from linter-gcc.
Hello. Could you please do the following: open the javascript console in atom, and look for the linter-gcc messages. It prints all its command-line parameters to the console, so the first thing to do is to copy those parameters and try to run them directly in the command-line.
from linter-gcc.
I am so sorry but I don't know how to do that, I toggled developer tools but I don't know what to do from there, can you guide me through the process if it isn't much trouble?
Thanks again
from linter-gcc.
Of course. With 'developer tools' on, you should see a sidebar, and at the bottom of this sidebar you'll see a button that says 'console'. Click it to view the console. Then go back to your C/C++ source file, and press Ctrl+S to save and trigger the linter. When you do this, you'll see something like this appear in the console:
/usr/bin/g++
["-Wall", "-std=c++0x", "-fmax-errors=0",
"-I/home/husam/.atom/packages/linter-gcc", "/tmp/sample.cpp"]
These are your command-line parameters. The first is the g++ binary, and the rest is the parameters given to g++. So, if we consider the example above, my full command would be:
/usr/bin/g++ -Wall -std=c++0x -fmax-errors=0 -I/home/husam/.atom/packages/linter-gcc /tmp/sample.cpp
You need to reconstruct your command in this way and run it in your terminal/command prompt to find out what g++/gcc is reporting.
from linter-gcc.
Okay, I got this:
/usr/bin/g++
main.js:149 ["-Wall", "-fmax-errors=0", "C:\Users\Nacho-PC2\Documents\TP FINAL.cpp"]
Then I changed it to this:
/usr/bin/g++main.js:149 -Wall, -fmax-errors=0, C:\Users\Nacho-PC2\Documents\TP FINAL.cpp
I have Windows, so I assume you mean put that in the cmd, I did that from the .atom directory (don´t know if this is right) and it says "The system cannot find the path specified."
I surely must be doing something wrong.
Damn, I hate being new to stuff :P
from linter-gcc.
Ok there are a few problems here:
- You need to remove the
main.js:149
from your command. You also need to remove all the commas. - It looks like you are trying to run /usr/bin/g++. Windows does not have a /usr/bin so this probably won't work on windows. You need to go into the linter-gcc configuration page and put the full location of the g++ binary in there. If you don't have one, I suggest you look at installing something something like mingw on windows.
- Secondly, you have a space in your file path. This will cause problems because a file path with spaces will cause gcc/g++ to parse part of your file path as a parameter, which it will complain about. To get around this problem, either change your file path and replace ALL spaces with underscores, or enclose the path within double quotes.
from linter-gcc.
Okay
- Done:
/usr/bin/g++ -Wall -fmax-errors=0 C:\Users\Nacho-PC2\Documents\TPFINAL.cpp
- I already have MinGW, so I guess the path that I´m looking for is:
C:\MinGW\bin\g++.exe
Right?
Also, by configuration page, you mean the linter-gcc/lib/main.js? Because I found this in there:
execPath: {
type: "string",
default: "/usr/bin/g++"
Maybe this is the problem?
- Done, see 1).
from linter-gcc.
No. That is not it. In the menu bar, click Packages > Settings view. Then click packages on the left and select linter-gcc. There you will find the linter-gcc settings. The first one is the executable path. Set that to your executable path, in your case C:\MinGW\g++.exe
.
from linter-gcc.
Okay, you left out the bin folder :P
But it´s working now, but the lint on the fly isn´t, I have to save the file for linter to show me the errors, any workaround this?
from linter-gcc.
No, this is deliberate. The reason it works like this is because C/C++ linting can be quite computationally intensive, so linting on-the-fly can cause high CPU load, especially with large files/projects.
from linter-gcc.
Ohhhhh, got it, well it's working perfectly now! Thanks a lot! :)
If it's no bother, I've got another question about Atom, but it's not related to linter-gcc, is there a private message button somewhere?
from linter-gcc.
Yes, that's fine. You can send me a message on twitter. My handle is hebaishi_husam. I'm closing this issue.
from linter-gcc.
Hi hebaishi,
I am trying to follow the instructions here to get linter-gcc working in windows and I am not having success. No output displays in the console when I save
from linter-gcc.
Thanks for the response. I did change the executable path to C:\MinGW\bin\g++.exe and also added C:\MinGW\bin to both the path system and user variables. I still don't see anything show up for linter-gcc in the console when I save.
from linter-gcc.
Hello. Your linter-gcc executable path should be set to g++.exe
, NOT C:\MinGW\bin\g++.exe
. This is because windows needs to find g++.exe
in your system path. Also, once you have changed your system PATH in the system properties, you might need to restart Atom for the change to take effect.
from linter-gcc.
great thank you for your reply. It is working now
from linter-gcc.
Hi hebaishi,
I'm sorry to bring this back up again but I've encountered a similar problem which appears persistent despite following instructions above. Linter is failing to find a number of standard c++ libraries including string and iostream, though using g++ to compile the same files in terminal works just fine. Do you have any suggestions on remedying this issue? Would the "GCC include paths" setting be the place to look? If so, which path ought I include?
from linter-gcc.
Same for me. I followed the instructions. I can compile without errors in Atom but I still get the linter error:
GCC | "iostream: No such file or directory"
from linter-gcc.
how to know the path which linter has installed ?
from linter-gcc.
I can confirm that the fix works but after various unsuccessful tries I found my solution for Windows 7.
Follow @hebaishi instructions about the installation of Cygwin and setting the PATH variable.
Test PATH by opening a new CMD and typing gcc –v
Close Atom and GitHub Desktop
Reopen and test if it works now.
from linter-gcc.
Related Issues (20)
- Linter isn't showing issues (c/c++) HOT 2
- it stops working since the 1.34.0 atom update HOT 2
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 2
- linter-gcc doesn't work HOT 4
- consider this project dead if this issue is not removed (latest commit was on 2017 jan) HOT 3
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 2
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 2
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 1
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 1
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 1
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 1
- Uncaught TypeError: _this.notificationEl.querySelector is not a function HOT 1
- Object.dirname is deprecated.
- Uncaught TypeError: Cannot read property 'binary' of undefined
- Relative paths are relative to Atom's $PWD, not the project root
- string variables not highlighted
- Colors in the linter panel
- I cant install atom linter gcc.its shows"npm WARN deprecated [email protected]: No longer maintained - Use lodash probably npm ERR! Unexpected end of JSON input while parsing near '...MGZNbL9YcGBJl4MH4nrxH' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\stark siv\.atom\.apm\_logs\2020-12-26T17_25_37_936Z-debug.log" A little help is appreciated,♥ HOT 2
- Just want my GCH address for open sea? HOT 1
- Cannot find module 'tempfile'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linter-gcc.