Centos installation code: Blocks

Source: Internet
Author: User
Tags wxwidgets

This afternoon, I'm free to try to install a code: blocks on centos in my PC. It's because Linux cainiao had a hard time in the afternoon, but I still have doubts:

I found that the official documents are the most reliable only after all the Gu Ge du Niang on the Internet: read here.

The above is a detailed description. The following is a brief summary of the installation steps:

WxWidgets Installation

Code: The blocks interface depends on wxWidgets, so you need to install it first. I don't know what wxWidgets is. We only know that wxWidgets is a cross-platform GUI library. in Linux, it depends on gdk +, and gdk + is equivalent to a function library, so you don't have to worry that it must be certain in your system. In fact, C: The wxWidgets actually used by B is wxgdk, so what we need to install first isWxgdkLibrary, version requirements greater than 2.8.0, the official documentation said libwxGDK-2.8.3 is a problem, so not recommended.

Download wxgdk: Here. For example, select wxgdk. in this example, wxgtk-2.8.12.tar.gz is used.

Decompress:

tar zxf wxGTK-2.8.12.tar.gzcd wxGTK-2.8.12

Installation:

mkdir build_gtk2_shared_monolithic_unicodecd build_gtk2_shared_monolithic_unicode../configure --prefix=/opt/wx/2.8 \       --enable-xrc \       --enable-monolithic \       --enable-unicodemakesumake installexit

The installation path is/opt/wx/2.8 /.

Set environment variables:

export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH

Run the following command:

ldconfigsource /etc/profile

 LdconfigThe function of a command is to share the dynamic link library with the system,SourceIn short, the command takes effect immediately without restarting the configuration file.

Installation code: Blocks

Before installing the GCC compiler, you must first check whether the GCC compiler is installed. If yum is not installed, it is very simple:

yum install gcc-c++

Note:: Not Yum install g ++. I took it for granted at first.

Download Code: blocks:Here. The tar package is under me.

Decompress the package and execute the following commands in sequence:

Bootstrap

./bootstrap

The function of the bootstrap command is to set the configure script and its dependency. This command only needs to be executed once. If the following error occurs, run this command:

./bootstrap: libtoolize: not found

It indicates that "libtool" is not installed on the machine. You can install it in Yum:

yum install libtool

Configure

./configure --with-wx-config=/opt/wx/2.8/bin/wx-config

Note:: If wxgdk is not installed in the default path, -- With-WX-config must be specified. Otherwise, an error is prompted during the make process.

Wait for the installation:

makemake install

After the installation is complete, you can find the C: B icon in the application.

However, after I install it, I find that it cannot be started. The error message is as follows:

 

The dynamic link library of libwx_gtk2u-2.8.s0.0 is not found, and the solution is to setLD_LIBRARY_PATHVariable:

export LD_LIBRARY_PATH =/opt/wx/2.8/lib/

This method is used to set the environment variables temporarily. If you close the shell, it will become invalid. You need to set the environment variables permanently. For more information, see here. Modify the/etc/profile file and add the following line:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/wx/2.8/lib"

LD_LIBRARY_PATHThis environment variable enables other programs to find third-party dynamic connection libraries. After setting, you cannot start C: B through the command line.

Question: But the strange thing is that I performed the above command under the root permission. According to the above instructions, this configuration method takes effect for all users, however, I have to switch to the root permission to start C: B and switch Through Su-. (For the difference between Su and Su-, see http://www.ha97.com/4001.html .) I don't know which student knows. I will study again.

Error Correction: The above questions I had when I restarted my computer were gone. I was so sorry (I actually sent it to the home page. I would like to ask more), but I am more familiar with Linux commands in one afternoon, for example, the difference between Su and Su-(here) has never been noticed before.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.