Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Atom linter-gcc not working on mac os #62

Closed
pwnywiz opened this issue May 30, 2016 · 23 comments
Closed

Atom linter-gcc not working on mac os #62

pwnywiz opened this issue May 30, 2016 · 23 comments
Labels

Comments

@pwnywiz
Copy link

pwnywiz commented May 30, 2016

Hi,
I've been using linter gcc on linux for a good time, helping me out quite a lot but when i tried to download it on mac os, it simply doesnt want to cooperate. My machine tries to use clang instead even though I've passed the path of my gcc compiler.. Is there any way to switch over to gcc instead of downloading the clang linter?
Thanks a lot

@pwnywiz
Copy link
Author

pwnywiz commented May 31, 2016

Solved

Self Update (for other curious users / people with the same problem)

xcode had installed its own gcc version which was probably beeing masked by clang even though it appeared in the ''which gcc'' path.
So I manually downloaded a stable gcc version through Homebrew (brew install gcc).
The summary reported that gcc was installed in the path /usr/local/Cellar/gcc/5.3.0.
The most important step was to pass the executable path of my manually installed gcc compiler to the settings of linter-gcc.
That should be /usr/local/Cellar/gcc/5.3.0/bin/gcc-5 (or whatever the summary path of your installation was, plus the /bin/gcc- ).
Hope this was helpful enough to someone else as well and will soften the pain! :)

@pwnywiz pwnywiz changed the title Not able to use linter gcc on mac os Atom linter-gcc not working on mac os May 31, 2016
@cgradwohl
Copy link

@pwnywiz huge help for me!! thank you!!

@hebaishi
Copy link
Contributor

hebaishi commented Jun 4, 2016

This is really useful information. I think I'll add it to the readme

@hebaishi hebaishi mentioned this issue Jun 13, 2016
3 tasks
@LeonardoLeite
Copy link

Thanks. Huge help here! 👍🏻

@ayberkt
Copy link

ayberkt commented Aug 24, 2016

I have set things up as described in this issue. Things are working fine except the following error I am getting.

clang -cclass: error: unable to open output file 'foo.o': 'Permission denied'.

Anyone had a similar problem?

@itorres-1
Copy link

Yes I have the same issue, except it is clang -cc1as (not -cclass). It says it is trying to open the name of my file with a ".o' extension, despite that I have saved it as a ".c" file.

@epiks
Copy link

epiks commented Nov 30, 2016

It disappears when I add -fsyntax-only to C++ flags.

It will not disappear when I add -fsyntax-only to C flags.

My gcc is /usr/local/bin/gcc-6 installed with homebrew.

@AntMartDev
Copy link

AntMartDev commented Dec 9, 2016

I am having the same issue as @ayberkt , I tried everything but I can't fix it.. I keep getting this error:

clang -cclass: error: unable to open output file 'somefile.o': 'Permission denied'.

Can anyone help with this?

@luisgiii
Copy link

Hi, I'm still getting an error message in Atom:

linter-gcc: Executable not found
"/usr/local/Cellar/gcc/6.2.0/bin/gcc-6" not found

So, the solution proposed is not fixing the issue even tho it would make perfect sense.

@luisgiii
Copy link

Ok, it was fixed by adding the gcc path "/usr/local/opt/gcc/bin/gcc-6" to /etc/paths file.
Sorry for the extra comment

@lhcavalcanti
Copy link

I also getting clang -cc1as: error unable to open output file 'co.o': 'Permission denied', Any one have solved it?

Thanks

@marcotollini
Copy link

Same here!
For instance, I have already added /usr/local/opt/gcc/bin/gcc-6 to my PATH and added in GCC executable path /usr/local/Cellar/gcc/6.3.0_1/bin/gcc-6

@Linh1706
Copy link

@epiks I do as you say. It works.
@hebaishi should you fix this ?

@Linh1706
Copy link

Linh1706 commented Jun 28, 2017 via email

@rezwanh001
Copy link

I am getting

Rezwans-iMac:sample rezwan$ make -f mkfile.r
cc -c main.c 
error: unable to open output file 'main.o': 'Permission denied'
1 error generated.
make: *** [main.o] Error 1

Any one have solved it?

@rezwanh001
Copy link

Hey, I have solved above issue using following command 👍

Rezwans-iMac:sample rezwan$ chmod +rw .

@ozzstrich ozzstrich mentioned this issue Nov 23, 2017
4 tasks
@lamhoangtung
Copy link

I installed gcc 8.1.0 via homebrew and added /usr/local/Cellar/gcc/8.1.0/bin/ to my PATH and added /usr/local/Cellar/gcc/8.1.0/bin/gcc-8 to the linter-gcc setting inside Atom. I aslo try to run ln -s gcc-8 gcc but nothing happened, linting on-the-fly still not working.

Anybody can help me with this problem ? Thanks you

@howlinweed
Copy link

@lamhoangtung
After installing gcc from homebrew and linking gcc-8 to gcc, I added /usr/local/bin/gcc to the GCC Executable Path setting for the package. However, it does look like there might be an issue with lint on-the-fly and using the current directory in the include path; easy work around seems to be to make a dedicated include folder with everything in it and add that to the include path.

And for any MacOS users that have made it this far and are still getting a clang error with all the correct linter and path settings, add the -o /dev/null argument to the C flags settings.

@jneuendorf
Copy link

I wanted to use this package for linting C files so I installed gcc with hombrew.
After brew install gcc, gcc still points to the XCode clang thing (/usr/bin) but gcc-8 (in my case - I guess the version number may differ) points to what homebrew installed ($(brew --prefix)/bin/gcc-8).

Thus I set gcc-8 as GCC Executable Path in the package settings. Atom's Settings GUI did not work for me so I used Atom > Config... to edit my config directly by setting execPath:

"*":
    # ...
    "linter-gcc":
        execPath: "gcc-8"
    # ...

@qtw1998
Copy link

qtw1998 commented Oct 8, 2018

I believe that the following sentence could make sense.
PATH=$PATH:/usr/local/Cellar/gcc/8.2.0/bin/gcc-8

@brankoto
Copy link

brankoto commented Jul 3, 2019

Still cannot get linter-gcc to work on Mac OS X . Is there a step by step instuction for noobs :))

thx

@dot-tb
Copy link

dot-tb commented Jul 3, 2019

Linter-gcc doesn't work at all, Mac OS or not, try with this one : Linter-gcc2

@LombardiDaniel
Copy link

@brankoto I know this is really late, but i had the same issue this week, just add the flag -fsyntax-only to your C and C++ flags in the package settings and it should work.

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

No branches or pull requests