I am getting this error when i tried to compile my program
-bash: g++: command not found
Also I have only been getting this error after I formatted my Mac Book Pro
This error came after I did this
g++ functions.cpp
Please help me.
Thank You
Here is a cleanest solution than installing XCode just for Gcc.
STEP 1 > install this:
[HomeBrew Web Site] (http://brew.sh/)
All the informations concerning the installation and the utility of such a program are on the site itself.
It's a package manager, but for Mac. It's like apt-get or yaourt, if you ever used Ubuntu or Arch Linux.
STEP 2 > Go to the Terminal application and type :
$> homebrew search gcc
Then choose from the version you want, and type again in Terminal:
$> homebrew install [choosen version]
Gcc is now installed.
Related
Using M1 Mac, I've followed the manual install procedures to install Repast HPC.
I'm trying to run ./install.sh rhpc and the following error persists:
configure: error: cannot not find the flags to link with Boost mpi
The suggested solution says to add the compiler wrappers with the following commands:
export PATH=$BASE_DIR/MPICH/bin:$PATH
MPI_COMPILER_INVOCATION=$BASE_DIR/MPICH/bin/mpicxx
which didn't work as the command mpicxx still couldn't be invoked.
So I tried installing mpich through homebrew, where mpicxx now works outside of the install. However, the error persists.
So I tried installing boost through homebrew and directing the install to the homebrew directory, but the error persists.
So I tried installing open-mpi through homebrew, and mpicxx still works, but the error persists.
Any suggestions? I'm running out of online resources to solve the issue.
I was trying to compile my code using gcc 10.2.8 and I got this error:
scons: *** [S.os] Error 1
In file included from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/cstdio:42,
from Public_Library/C.h:10,
from Public_Library/D.h:11,
from Public_Library/RS.h:10,
from Projects/S/main.cpp:1:
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin18/10.2.0/include-fixed/stdio.h:219:10: fatal error: _ctermid.h: No such file or directory
I found a few questions like this but the problem is I don't have Xcode on my mac and I have already updated my CommandLine tools several times and it did not work.
I'm using OSX 10.14.6 by the way.
I'm just gonna add this in case it might help others. I updated my OSX to big sure and installed Xcode but that did not help. What solved the problem for me was getting an unshallow version of brew with this command:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
and then updating and upgrading my brew.
brew update
brew upgrade
I've recently installed gcc using Home-brew. Here are the details about my home-brew:
The command, 'which gcc' results to: /usr/bin/gcc
And the command 'brew info gcc' results to: Required: gmp ✔, isl ✔, libmpc ✔, mpfr ✔
When ever I type in #include <ext/pb_ds ... it shows me a whole bunch of files I've never downloaded before which means that GCC and all of the files are actually downloaded.
As you can see above,it clearly shows me the files.
Here is what it looks like in my finder:
However, I still recieve this error:
g++ -std=c++11 testprogram1.cpp -o testprogram1
testprogram1.cpp:2:9: fatal error: 'ext/pb_ds/assoc_container.hpp' file not found
#include<ext/pb_ds/assoc_container.hpp>
I'm not so sure why it is giving me this error even though I clearly have all of the files working.
Someone told me that when I typed 'which gcc' it was meant to appear /usr/local/bin/g++-9 and not '/usr/bin/gcc.
Maybe this could be the reason why but im not too sure how to fix(change) that. Thank you.
P.S: im using visual studio code and a mac. And these were the following steps when I installed HomeBrew:
**1. export HOMEBREW_NO_ANALYTICS=1
brew update
brew upgrade
brew info gcc
brew install gcc
brew cleanup**
When debugging a C++ project in Eclipse I get the following error:
'Launching Project.exe' has encountered a problem.
Could not determine GDB version using command:
D:\Programme\MinGW\bin\gdb.exe --version
Some Posts on Stackoverflow suggested linking MinGW\bin\gdb.exe directly in the C++/GDB settings solves the problem, but as you can see it didn't for me.
Any suggestions?
Edit: Tried mingw-get.exe install gdb in MinGW\bin, got an error that said the latest version is already installed.
I found the solution for my --version error:
When I ran $ gdb --version from the MinGW shell I got an error message saying zlib1.dll was not found.
I copied zlib1.dll from the \Debug folder of my C++ project into MinGW\bin and now it's working.
If gdb --version works in cmd, then try change path in eclipse - run - debug configurations - debugger - GDB debugger to C:\MinGW\gdb64\bin\gdb.exe, the default one in C:\MinGW\bin could be 32-bit.
I try to compile live555 library for eCos system. I don't pretty sure how to do this, so i try option build this under arm compiler. so as tutorial online. I type :
./genMakefiles armlinux
after that, i type : make and meet this error:
arm-elf-g++: Command not found
I think that arm-elf-g++ compiler that my machine doesn't install yet. I google, but no result how to install. (i'm currently using Ubuntu 13.04 64 bit). please tell me how to fix this.
Try something like this:
sudo apt-get install gcc-arm-linux-gnueabi
Here are a couple of links for installing an ARM toolchain on Ubuntu:
https://askubuntu.com/questions/65630/installing-gnu-arm-toolchain
https://groups.google.com/forum/#!topic/levana-technologies/MiGqkDn3ARQ