-bash: gcc-8.0.2: command not found (But it's there)
My mac cann't find the gcc.
DorothydeMacBook:Desktop dorothy$ gcc
-bash: gcc-8.0.2: command not found
But it exits.
DorothydeMacBook:Desktop dorothy$ which gcc
/usr/local/bin/gcc
I can find them in /usr/local/bin
x86_64-apple-darwin18.2.0-c++-8
x86_64-apple-darwin18.2.0-g++-8
x86_64-apple-darwin18.2.0-gcc-8
x86_64-apple-darwin18.2.0-gcc-8.2.0
x86_64-apple-darwin18.2.0-gcc-ar-8
x86_64-apple-darwin18.2.0-gcc-nm-8
x86_64-apple-darwin18.2.0-gcc-ranlib-8
x86_64-apple-darwin18.2.0-gfortran-8
g++
g++-8
gcc
gcc-8
gcc-ar
gcc-ar-8
gcc-nm
gcc-nm-8
gcc-ranlib
gcc-ranlib-8
DorothydeMacBook:~ dorothy$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/dg/l7bh29111hl_7jsfspzbs2d80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.92LjvvFjN3/Render
TERM_PROGRAM_VERSION=421.1
OLDPWD=/Users/dorothy/Desktop
TERM_SESSION_ID=83E312BB-F4C2-4DA7-B123-38BAA4242C89
USER=dorothy
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Y7k1UOMg8c/Listeners
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/Cellar/gcc/8.0.2/lib:/usr/local/Cellar/gcc/8.0.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
PWD=/Users/dorothyXPC_FLAGS=0x0
XPC_SERVICE_NAME=0
HOME=/Users/dorothy
SHLVL=1
LOGNAME=dorothy
LC_CTYPE=UTF-8
DISPLAY=/private/tmp/com.apple.launchd.U7xfsLeEtc/org.macosforge.xquartz:0
MyComputer=u1795058@joshua.dcs.warwick.ac.uk
SECURITYSESSIONID=186a8
_=/usr/bin/env
The details of the system path are listed:
The /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
~
~
How can I use gcc ?
gcc compiler-errors
add a comment |
My mac cann't find the gcc.
DorothydeMacBook:Desktop dorothy$ gcc
-bash: gcc-8.0.2: command not found
But it exits.
DorothydeMacBook:Desktop dorothy$ which gcc
/usr/local/bin/gcc
I can find them in /usr/local/bin
x86_64-apple-darwin18.2.0-c++-8
x86_64-apple-darwin18.2.0-g++-8
x86_64-apple-darwin18.2.0-gcc-8
x86_64-apple-darwin18.2.0-gcc-8.2.0
x86_64-apple-darwin18.2.0-gcc-ar-8
x86_64-apple-darwin18.2.0-gcc-nm-8
x86_64-apple-darwin18.2.0-gcc-ranlib-8
x86_64-apple-darwin18.2.0-gfortran-8
g++
g++-8
gcc
gcc-8
gcc-ar
gcc-ar-8
gcc-nm
gcc-nm-8
gcc-ranlib
gcc-ranlib-8
DorothydeMacBook:~ dorothy$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/dg/l7bh29111hl_7jsfspzbs2d80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.92LjvvFjN3/Render
TERM_PROGRAM_VERSION=421.1
OLDPWD=/Users/dorothy/Desktop
TERM_SESSION_ID=83E312BB-F4C2-4DA7-B123-38BAA4242C89
USER=dorothy
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Y7k1UOMg8c/Listeners
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/Cellar/gcc/8.0.2/lib:/usr/local/Cellar/gcc/8.0.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
PWD=/Users/dorothyXPC_FLAGS=0x0
XPC_SERVICE_NAME=0
HOME=/Users/dorothy
SHLVL=1
LOGNAME=dorothy
LC_CTYPE=UTF-8
DISPLAY=/private/tmp/com.apple.launchd.U7xfsLeEtc/org.macosforge.xquartz:0
MyComputer=u1795058@joshua.dcs.warwick.ac.uk
SECURITYSESSIONID=186a8
_=/usr/bin/env
The details of the system path are listed:
The /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
~
~
How can I use gcc ?
gcc compiler-errors
What doestype -a gccshow?
– Florian Weimer
Jan 19 at 12:32
@FlorianWeimer Thank you for looking through my question. I still have a problem linking stdio.h with gcc. However, I have found another way to use gcc 8.0.2 by invoking new gcc I installed in my mac using "gcc-8" instead of "gcc"
– White Thigh
Jan 25 at 19:06
add a comment |
My mac cann't find the gcc.
DorothydeMacBook:Desktop dorothy$ gcc
-bash: gcc-8.0.2: command not found
But it exits.
DorothydeMacBook:Desktop dorothy$ which gcc
/usr/local/bin/gcc
I can find them in /usr/local/bin
x86_64-apple-darwin18.2.0-c++-8
x86_64-apple-darwin18.2.0-g++-8
x86_64-apple-darwin18.2.0-gcc-8
x86_64-apple-darwin18.2.0-gcc-8.2.0
x86_64-apple-darwin18.2.0-gcc-ar-8
x86_64-apple-darwin18.2.0-gcc-nm-8
x86_64-apple-darwin18.2.0-gcc-ranlib-8
x86_64-apple-darwin18.2.0-gfortran-8
g++
g++-8
gcc
gcc-8
gcc-ar
gcc-ar-8
gcc-nm
gcc-nm-8
gcc-ranlib
gcc-ranlib-8
DorothydeMacBook:~ dorothy$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/dg/l7bh29111hl_7jsfspzbs2d80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.92LjvvFjN3/Render
TERM_PROGRAM_VERSION=421.1
OLDPWD=/Users/dorothy/Desktop
TERM_SESSION_ID=83E312BB-F4C2-4DA7-B123-38BAA4242C89
USER=dorothy
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Y7k1UOMg8c/Listeners
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/Cellar/gcc/8.0.2/lib:/usr/local/Cellar/gcc/8.0.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
PWD=/Users/dorothyXPC_FLAGS=0x0
XPC_SERVICE_NAME=0
HOME=/Users/dorothy
SHLVL=1
LOGNAME=dorothy
LC_CTYPE=UTF-8
DISPLAY=/private/tmp/com.apple.launchd.U7xfsLeEtc/org.macosforge.xquartz:0
MyComputer=u1795058@joshua.dcs.warwick.ac.uk
SECURITYSESSIONID=186a8
_=/usr/bin/env
The details of the system path are listed:
The /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
~
~
How can I use gcc ?
gcc compiler-errors
My mac cann't find the gcc.
DorothydeMacBook:Desktop dorothy$ gcc
-bash: gcc-8.0.2: command not found
But it exits.
DorothydeMacBook:Desktop dorothy$ which gcc
/usr/local/bin/gcc
I can find them in /usr/local/bin
x86_64-apple-darwin18.2.0-c++-8
x86_64-apple-darwin18.2.0-g++-8
x86_64-apple-darwin18.2.0-gcc-8
x86_64-apple-darwin18.2.0-gcc-8.2.0
x86_64-apple-darwin18.2.0-gcc-ar-8
x86_64-apple-darwin18.2.0-gcc-nm-8
x86_64-apple-darwin18.2.0-gcc-ranlib-8
x86_64-apple-darwin18.2.0-gfortran-8
g++
g++-8
gcc
gcc-8
gcc-ar
gcc-ar-8
gcc-nm
gcc-nm-8
gcc-ranlib
gcc-ranlib-8
DorothydeMacBook:~ dorothy$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/dg/l7bh29111hl_7jsfspzbs2d80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.92LjvvFjN3/Render
TERM_PROGRAM_VERSION=421.1
OLDPWD=/Users/dorothy/Desktop
TERM_SESSION_ID=83E312BB-F4C2-4DA7-B123-38BAA4242C89
USER=dorothy
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Y7k1UOMg8c/Listeners
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/Cellar/gcc/8.0.2/lib:/usr/local/Cellar/gcc/8.0.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
PWD=/Users/dorothyXPC_FLAGS=0x0
XPC_SERVICE_NAME=0
HOME=/Users/dorothy
SHLVL=1
LOGNAME=dorothy
LC_CTYPE=UTF-8
DISPLAY=/private/tmp/com.apple.launchd.U7xfsLeEtc/org.macosforge.xquartz:0
MyComputer=u1795058@joshua.dcs.warwick.ac.uk
SECURITYSESSIONID=186a8
_=/usr/bin/env
The details of the system path are listed:
The /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
~
~
How can I use gcc ?
gcc compiler-errors
gcc compiler-errors
asked Jan 19 at 9:06
White ThighWhite Thigh
114
114
What doestype -a gccshow?
– Florian Weimer
Jan 19 at 12:32
@FlorianWeimer Thank you for looking through my question. I still have a problem linking stdio.h with gcc. However, I have found another way to use gcc 8.0.2 by invoking new gcc I installed in my mac using "gcc-8" instead of "gcc"
– White Thigh
Jan 25 at 19:06
add a comment |
What doestype -a gccshow?
– Florian Weimer
Jan 19 at 12:32
@FlorianWeimer Thank you for looking through my question. I still have a problem linking stdio.h with gcc. However, I have found another way to use gcc 8.0.2 by invoking new gcc I installed in my mac using "gcc-8" instead of "gcc"
– White Thigh
Jan 25 at 19:06
What does
type -a gcc show?– Florian Weimer
Jan 19 at 12:32
What does
type -a gcc show?– Florian Weimer
Jan 19 at 12:32
@FlorianWeimer Thank you for looking through my question. I still have a problem linking stdio.h with gcc. However, I have found another way to use gcc 8.0.2 by invoking new gcc I installed in my mac using "gcc-8" instead of "gcc"
– White Thigh
Jan 25 at 19:06
@FlorianWeimer Thank you for looking through my question. I still have a problem linking stdio.h with gcc. However, I have found another way to use gcc 8.0.2 by invoking new gcc I installed in my mac using "gcc-8" instead of "gcc"
– White Thigh
Jan 25 at 19:06
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54265565%2fbash-gcc-8-0-2-command-not-found-but-its-there%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54265565%2fbash-gcc-8-0-2-command-not-found-but-its-there%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What does
type -a gccshow?– Florian Weimer
Jan 19 at 12:32
@FlorianWeimer Thank you for looking through my question. I still have a problem linking stdio.h with gcc. However, I have found another way to use gcc 8.0.2 by invoking new gcc I installed in my mac using "gcc-8" instead of "gcc"
– White Thigh
Jan 25 at 19:06