If you install macports you can install gcc select, and then choose your gcc version.
/opt/local/bin/port install gcc_select
To see your versions use
port select --list gcc
To select a version use
sudo port select --set gcc gcc40
Related Posts:
- What is the difference between g++ and gcc?
- Undefined reference to vtable
- Undefined reference to vtable
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- Compiling a C++ program with gcc
- gcc/g++: “No such file or directory”
- error: use of deleted function
- G++ undefined reference to class::function
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- g++ ld: symbol(s) not found for architecture x86_64
- C++ undefined reference to defined function
- Convert char to int in C and C++
- C++ IDE for Macs
- How does #include
work in C++? - Expected initializer before function name
- Inheriting constructors
- make: g++: Command not found
- C ++ error: a expected initializer before [function name]
- Inheriting constructors
- Compiling C++11 with g++
- “g++” is not recognized as an internal or external command, MinGW
- undefined reference to ‘std::cout’
- Eclipse C++ : “Program “g++” not found in PATH”
- MinGW: “gcc is not recognized as an internal or external command”
- C++ on mac : linker command failed with exit code 1 (use -v to see invocation)
- “g++” is not recognized as an internal or external command, MinGW
- Visual C++ find line causing “Debug Assertion failed”
- Undefined reference to class constructor, including .cpp file fixes
- Undefined reference to constructor
- CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found
- expected unqualified-id before string constant
- cc1plus: error: unrecognized command line option “-std=c++11” with g++
- cannot declare variable ‘’ to be of abstract type ‘’
- extra qualification error in C++
- C++ Error ‘nullptr was not declared in this scope’ in Eclipse IDE
- Debug vs Release in CMake
- Debug vs Release in CMake
- Compiling simple Hello World program on OS X via command line
- What does the fpermissive flag do?
- Error: free(): invalid next size (fast):
- gcc: undefined reference to
- Error: free(): invalid next size (fast):
- I get this error: “glibc detected”
- Undefined reference to class constructor, including .cpp file fixes
- GCC -fPIC option
- gcc -g :what will happen
- Difference between
and - Warning : overflow in implicit constant conversion
- Getting a bunch of crosses initialization error
- Expected unqualified-id before ‘[‘ token
- cc1.exe System Error – libwinpthread-1.dll missing – But it isn’t
- How to Check the Version of my gcc?
- What does “-Wall” in “g++ -Wall test.cpp -o test” do?
- Make / gcc cryptic error 2: how to have more information?
- Is there a way to compile C++ to C Code?
- Compiling C++11 with g++
- Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file
- What is a .h.gch file?
- Update g++ but still old version
- “please check gdb is codesigned – see taskgated(8)” – How to get gdb installed with homebrew code signed?
- Link error “undefined reference to `__gxx_personality_v0′” and g++ [duplicate]
- What is the best way to use a HashMap in C++?
- Sleep for milliseconds
- What is an undefined reference/unresolved external symbol error and how do I fix it?
- c++ compile error: ISO C++ forbids comparison between pointer and integer
- How do I declare a 2d array in C++ using new?
- What does “#include
” do? - How to convert an instance of std::string to lower case
- Error: No viable overloaded =
- Random number between 1 to 10 using C++
- Expected initializer before namespace
- Separating class code into a header and cpp file
- Deep copy vs Shallow Copy
- Pointer to incomplete class type is not allowed
- C++ error: “Array must be initialized with a brace enclosed initializer”
- Checking cin input stream produces an integer
- Where do “pure virtual function call” crashes come from?
- What is the best open XML parser for C++?
- *** No rule to make target ‘class.cpp’, needed by `build/….x86/class.o` Stop. error in Ubuntu
- What’s the difference between opening a file with ios::binary or ios::out or both?
- Hash function for a string
- How to run valgrind with basic c example?
- initial value of reference to non-const must be an lvalue
- Typedef function pointer?
- Strange error C2131: expression did not evaluate to a constant in VC 2015
- error: called object type ‘int’ is not a function or function pointer
- Hash function for a string
- Is there a replacement for unistd.h for Windows (Visual C)?
- How to call on a function found on another file?
- how to convert from int to char*?
- When is it safe to call this-> in constructor and destructor
- ASCII art in C++
- How do you append an int to a string in C++?
- C++ correct way to return pointer to array from function
- Understanding error “terminate called after throwing an instance of ‘std::length_error’ what(): basic_string::_S_create Aborted (core dumped)”
- how to find 2d array size in c++
- Unexpected end of file error
- virtual memory exhausted: Cannot allocate memory
- How to find and replace string?
- allocating an object of abstract class type error