Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Fedora 5 gcc

2025-03-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install Fedora 5 gcc", the content is simple and easy to understand, organized clearly, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to install Fedora 5 gcc" this article bar.

How to install Fedora 5 gcc

1. Download the BZ2 package.

2. Decompress and establish srcdir=gcc-3.3.5, objdir =gcc; the two are not repeated

3./ configure --prefix=/home/gcc --mandir=/home/gcc/share/man --infodir=/home/gcc/share/info --with-gcc-version-trigger=/home/gcc-3.3.5/gcc/version.c --host=i686-pc-linux-gnu --enable-languages=c,c++

4.make

5 make install

6. All files in GCC 3.3.5, including command files (such as gcc, g++) and library files, are stored in the ${destdir} directory, such as command files in the bin directory, library files in lib, header files in include, etc. Because the directories where command files and library files are located are not yet included in the corresponding search path, the compiler must make appropriate settings before it can find and use them successfully.

To install Fedora 5 gcc 3.3.5 with commands like gcc, an easy way is to put its path ${destdir}/bin in the environment variable PATH. Instead of doing this, I implemented it symbolically, and the advantage of doing so was that I could still use the old Fedora 5 gcc compiler installed on my system.

First, check the path where Fedora 5 gcc was installed:

[root@localhost ~]# which gcc/usr/bin/gcc

We can make a symbolic link between gcc, g++, gcj, etc. in GCC 3.3.5 in the/usr/bin directory:

[root@localhost bin]# ln -s /home/gcc/bin/gcc gcc335

[root@localhost bin]# ln -s /home/gcc/bin/g++ g++335

In this way, you can use gcc 3.3.5, g++3.3.5 to call GCC 3.3.5 gcc, g++j to complete the compilation of C, C++ programs. At the same time, it is still possible to install Fedora 5 gcc, g++, etc. from older versions of the Fedora 5 gcc compiler.

Settings for Library Path

Add the ${destdir}/lib path to the LD_LIBRARY_PATH environment variable and *** to the system configuration file so that it is not necessary to set this environment variable every time.

For example, if Fedora 5 gcc 3.4.0 is installed in/usr/local/gcc-3.4.0, it can be executed directly on the command line under RH Linux or the following sentence can be added to the file/etc/profile:

setenv LD_LIBRARY_PATH /usr/local/gcc-3.4.0/lib:$LD_LIBRARY_PATH

test

Install Fedora 5 gcc Build your old C, C++ programs with the new build commands (gcc34, g++34, etc.) and verify that the newly installed GCC compiler works properly. Add the ${destdir}/lib path to the LD_LIBRARY_PATH environment variable and *** to the system configuration file so that it is not necessary to set this environment variable every time.

That's all for "How to install Fedora 5 gcc", thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report