“/bin/bash: g++: command not found”
I am new to ubuntu and facing problems in running c++ code.
> Executing task: g++ -g hello.cpp -o hello.out && clear && ./hello.out <
/bin/bash: g++: command not found
The terminal process terminated with exit code: 127
I tried many instructions but not solved.
Any suggestions?
Thanks in advance.
g++
add a comment |
I am new to ubuntu and facing problems in running c++ code.
> Executing task: g++ -g hello.cpp -o hello.out && clear && ./hello.out <
/bin/bash: g++: command not found
The terminal process terminated with exit code: 127
I tried many instructions but not solved.
Any suggestions?
Thanks in advance.
g++
1
Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
– vidarlo
Feb 6 at 18:21
3
Did you installbuild-essential
withsudo apt install build-essential
? It installs all the other required libraries as well asgcc
/g++
– Thomas Ward♦
Feb 6 at 18:47
BTW, for the update errors, see What can I do if a repository/PPA I added does not have a Release file?
– wjandrea
Feb 6 at 20:16
Could the issue be that you have (somehow - perhaps by temporarily enabling Ubuntu "Disco Dingo" repositories) installedgcc
version4:8.2.0-2ubuntu2
in place of the default8.2.0-1ubuntu1
wanted by Cosmic?
– steeldriver
Feb 6 at 22:11
add a comment |
I am new to ubuntu and facing problems in running c++ code.
> Executing task: g++ -g hello.cpp -o hello.out && clear && ./hello.out <
/bin/bash: g++: command not found
The terminal process terminated with exit code: 127
I tried many instructions but not solved.
Any suggestions?
Thanks in advance.
g++
I am new to ubuntu and facing problems in running c++ code.
> Executing task: g++ -g hello.cpp -o hello.out && clear && ./hello.out <
/bin/bash: g++: command not found
The terminal process terminated with exit code: 127
I tried many instructions but not solved.
Any suggestions?
Thanks in advance.
g++
g++
edited Feb 6 at 20:14
wjandrea
9,28942664
9,28942664
asked Feb 6 at 18:14
zeeshanzeeshan
1
1
1
Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
– vidarlo
Feb 6 at 18:21
3
Did you installbuild-essential
withsudo apt install build-essential
? It installs all the other required libraries as well asgcc
/g++
– Thomas Ward♦
Feb 6 at 18:47
BTW, for the update errors, see What can I do if a repository/PPA I added does not have a Release file?
– wjandrea
Feb 6 at 20:16
Could the issue be that you have (somehow - perhaps by temporarily enabling Ubuntu "Disco Dingo" repositories) installedgcc
version4:8.2.0-2ubuntu2
in place of the default8.2.0-1ubuntu1
wanted by Cosmic?
– steeldriver
Feb 6 at 22:11
add a comment |
1
Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
– vidarlo
Feb 6 at 18:21
3
Did you installbuild-essential
withsudo apt install build-essential
? It installs all the other required libraries as well asgcc
/g++
– Thomas Ward♦
Feb 6 at 18:47
BTW, for the update errors, see What can I do if a repository/PPA I added does not have a Release file?
– wjandrea
Feb 6 at 20:16
Could the issue be that you have (somehow - perhaps by temporarily enabling Ubuntu "Disco Dingo" repositories) installedgcc
version4:8.2.0-2ubuntu2
in place of the default8.2.0-1ubuntu1
wanted by Cosmic?
– steeldriver
Feb 6 at 22:11
1
1
Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
– vidarlo
Feb 6 at 18:21
Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
– vidarlo
Feb 6 at 18:21
3
3
Did you install
build-essential
with sudo apt install build-essential
? It installs all the other required libraries as well as gcc
/g++
– Thomas Ward♦
Feb 6 at 18:47
Did you install
build-essential
with sudo apt install build-essential
? It installs all the other required libraries as well as gcc
/g++
– Thomas Ward♦
Feb 6 at 18:47
BTW, for the update errors, see What can I do if a repository/PPA I added does not have a Release file?
– wjandrea
Feb 6 at 20:16
BTW, for the update errors, see What can I do if a repository/PPA I added does not have a Release file?
– wjandrea
Feb 6 at 20:16
Could the issue be that you have (somehow - perhaps by temporarily enabling Ubuntu "Disco Dingo" repositories) installed
gcc
version 4:8.2.0-2ubuntu2
in place of the default 8.2.0-1ubuntu1
wanted by Cosmic?– steeldriver
Feb 6 at 22:11
Could the issue be that you have (somehow - perhaps by temporarily enabling Ubuntu "Disco Dingo" repositories) installed
gcc
version 4:8.2.0-2ubuntu2
in place of the default 8.2.0-1ubuntu1
wanted by Cosmic?– steeldriver
Feb 6 at 22:11
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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%2faskubuntu.com%2fquestions%2f1116170%2fbin-bash-g-command-not-found%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 Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1116170%2fbin-bash-g-command-not-found%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
1
Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
– vidarlo
Feb 6 at 18:21
3
Did you install
build-essential
withsudo apt install build-essential
? It installs all the other required libraries as well asgcc
/g++
– Thomas Ward♦
Feb 6 at 18:47
BTW, for the update errors, see What can I do if a repository/PPA I added does not have a Release file?
– wjandrea
Feb 6 at 20:16
Could the issue be that you have (somehow - perhaps by temporarily enabling Ubuntu "Disco Dingo" repositories) installed
gcc
version4:8.2.0-2ubuntu2
in place of the default8.2.0-1ubuntu1
wanted by Cosmic?– steeldriver
Feb 6 at 22:11