In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install CodeBlocks in CentOS, which is very detailed and has a certain reference value. Friends who are interested must finish reading it!
I. installation platform description:
CentOs6.4-i686 gcc-4.4.7
2. Download the latest source code:
Http://www.codeblocks.org/downloads
Installed here is the latest version: Code::Blocks 16.01
3. Read the official installation instructions:
Http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux
The following information can be obtained by reading the official installation instructions:
Installing CodeBlocks has the following dependencies:
Code::Blocks- > xwWidget (> libwxGTK2.8)-> GTK+ (> libgtk-x11-2.0)-> X
In other words, you need to install the X system, the desktop bar, then install libgtk-x11-2.0, then install libwxGTK2.8, and finally start the source installation of Code::Blocks.
4. Install in turn according to the above dependencies:
1. Create a directory:
Mkdir ~ / devel / / create a devel directory in the home directory, which can be freely specified
two。 Install the GTK+ (libgtk-x11-20) library:
Yum install gtk+*
3. Install the wxGTK (libwxGTK2.8) library with source code:
Download the wxGTK source code:
Https://sourceforge.net/projects/wxwindows/files/2.8.7/
Be sure to select the following source code package, and don't make a mistake:
Copy the downloaded source code to the directory created earlier: ~ / devel/, and unzip it:
1 mv. / Desktop/wxGTK-2.8.12.tar.gz devel/ copy the desktop wxGTK source package to the previously established working directory devel
2 cd devel/ enter the devel directory
3 tar zxvf wxGTK-2.8.12.tar.gz / / decompress the source code packet
Go to the wxGTK-2.8.12 directory and execute the following command:
Mkdir build_gtk2_shared_monolithic_unicode / / set up a compilation directory
Cd build_gtk2_shared_monolithic_unicode / / enter the directory you just created
.. / configure-prefix=/opt/wx/2.8-enable-xrc-enable-monolithic-enable-unicode / / execute the configure script file
Make / / start compilation
Su / / switch to root
Make install / / start installation
The installation process is as follows:
After performing the above steps, you can see that Makefile has been generated, and you can compile make at this time:
Make / / start compilation
When the compilation is complete, start installing make install:
Su root / / switch to root user
Make install / / start installation
The following message indicates that the installation of the wxGTK library is complete:
4. Now that all the above preparations have been done, start installing Code::Blocks:
Similarly, copy the CB source code to the working directory we created earlier: ~ / devel, and then enter the source code directory:
Mv.. / Desktop/codeblocks-16.01.release/. / / copy the codeblocks source package to the current directory (devel/)
Cd codeblocks.16.01.release/ enter the source directory
Copy the wxwin.m4 under wxGTK-2.8.12 to / usr/share/aclocal:
Cp wxwin.m4 / usr/share/aclocal / / copy the wxwin.m4 under wxGTK-2.8.12 to / usr/share/aclocal
Enter the CodeBlocks source directory and execute. / bootstrap:
. / bootstrap
Start executing the configure script:
/ / Note here / the path of opt/wx/2.8/bin/wx-config should be the path where you installed wxGTK.
. / configure-with-wx-config=/opt/wx/2.8/bin/wx-config
Start compilation: make
Make / / start compilation
Switch to root installation:
Su root / / switch to root user
Make install / / start installation
At this point you can see that CodeBlocks has been installed:
5. Start CodeBlocks:
1. Start from the command line:
All the above steps install CodeBlocks to the linux system, but there will be problems if we start it directly:
The reason is that libwx_gtk2u-2.8.so.0, a dynamic link library, cannot be found.
The solution is as follows:
Vim / etc/profile
/ / add the following environment variable to the end of the file:
/ / Note here / the path of opt/wx/2.8/lib should be the path where you installed wxGTK.
Export LD_LIBRARY_PATH= "$LD_LIBRARY_PATH:/opt/wx/2.8/lib
Execute after saving: source / etc/profile to make the configuration file take effect immediately.
Finally, the command line starts CodeBlocks successfully:
two。 Start with the desktop icon:
After the default installation, the desktop does not have an icon, so it cannot be started by double-clicking. At this point, we need to create an initiator:
Right click on the desktop-> CreateLaucher:
Fill in the following information and click OK:
At this point, the desktop will generate a codeblocks icon, which can be started by double-clicking (Note: if double-click does not start, you need to restart the system):
Six. whether the test of the new project can run normally:
At this point, we can compile successfully, but the console window cannot pop up at run time:
The reason is that xterm instead of gnome console is used to start CB by default. The solution is as follows: Setings- > Environment
Everything is fine when you click the execute button at this time:
The above is all the contents of the article "how to install CodeBlocks in CentOS". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.