Joined
·
2,198 Posts
If you have the developer tools installed, you can use the <code>gcc_select</code> command to switch between different versions of gcc:
<code>
[email protected]:~$ sudo gcc_select 2
Default compiler has been set to:
Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2 19991024 (release)
[email protected]:~$ gcc --version
2.95.2
[email protected]:~$ sudo gcc_select 3
Default compiler has been set to:
Apple Computer, Inc. GCC version 1256, based on gcc version 3.1 20021003 (prerelease)
[email protected]:~$ gcc --version
gcc (GCC) 3.1 20021003 (prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[email protected]:~$ sudo gcc_select 3.3
Default compiler has been set to:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
[email protected]:~$ gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</code>
<code>
[email protected]:~$ sudo gcc_select 2
Default compiler has been set to:
Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2 19991024 (release)
[email protected]:~$ gcc --version
2.95.2
[email protected]:~$ sudo gcc_select 3
Default compiler has been set to:
Apple Computer, Inc. GCC version 1256, based on gcc version 3.1 20021003 (prerelease)
[email protected]:~$ gcc --version
gcc (GCC) 3.1 20021003 (prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[email protected]:~$ sudo gcc_select 3.3
Default compiler has been set to:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
[email protected]:~$ gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</code>