I need to compile a program in GCC 3, however i currently have GCC2 installed(e.g typing "gcc" will run the gcc2 gcc) I'd rather still keep GCC 2, but i want GCC 3 to be the default compiler used to compile my programs. How would i go about doing this? Are there any HOWTO's on the net about doing this? Thanks for your help.
On Friday 04 October 2002 20.48, Stuart Urquhart wrote:
I need to compile a program in GCC 3, however i currently have GCC2 installed(e.g typing "gcc" will run the gcc2 gcc)
I'd rather still keep GCC 2, but i want GCC 3 to be the default compiler used to compile my programs.
How would i go about doing this? Are there any HOWTO's on the net about doing this?
Thanks for your help.
Assuming you've installed gcc3 in /opt/gcc3, just put /opt/gcc3/bin first in your PATH and /opt/gcc3/lib in your LD_LIBRARY_PATH. For your user, put export PATH=/opt/gcc3/bin:$PATH export LD_LIBRARY_PATH=/opt/gcc3/lib:$LD_LIBRARY_PATH in your .bashrc or corresponding file if you use another shell. If you have access to the root account you could put /opt/gcc3/lib in /etc/ld.so.conf, run ldconfig and forget about the LD_LIBRARY_PATH //Anders -- 'Deserves [death]. I daresay he does. Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends.' --Tolkien, The Lord of the Rings
Anders Johansson [ Fri, 4 Oct 2002 19:58:46 +0200]:
export PATH=/opt/gcc3/bin:$PATH export LD_LIBRARY_PATH=/opt/gcc3/lib:$LD_LIBRARY_PATH
Yes, that will work. But You have to remember that on such a system you can only recompile C programs and have to stay away from most C++ programs and libraries as the ABI (Application Binary Interface) changed with 3.2 so programs compiled with 3.2 will not work with libraries compiled by 2.95.X (most prominently Qt and the KDE Libraries) and vice versa. That's why I'd recommend to switch to 8.1 where everything is compiled with 3.2. Philipp -- Philipp Thomas work: pthomas@suse.de Development SuSE Linux AG private: pth@t-link.de
participants (3)
-
Anders Johansson
-
Philipp Thomas
-
Stuart Urquhart