Finally, we installed the Code: Blocks on the CentOS virtual machine. I felt a lot and learned a lot. Focus on step 2 of the installation step and set environment variables.
Main reference links:
- Install the c ++ compiler CodeBlocks in Linux
- WxWidgets error (the wxWidgets is installed in the same way as me, but the system prompts that the wood is installed. WxWidgets)
Version Parameters
Operating System: CentOS 5.2
Development Library: wxWidgets-2.8.12
Software Version: codeblocks-10.05
Install wxWidgets
1. Download wxWidgets source package, address: http://www.wxwidgets.org/downloads/
2. decompress the package. You can use the tar command, or right-click the CentOS command.
3. Enter the decompressed directory, open the terminal, and enter the following commands in sequence
./Configure (it is best not to add the prefix parameter. Using the default settings will be more conducive to the smooth progress of the subsequent steps)
Make (compile. This process is quite long. You can fight two landlords and come back)
Make install (installation .)
After the installation is complete, the terminal outputs the following prompt:
The installation of wxWidgets is finished. On certain
Platforms (e.g. Linux) you'll now have to run ldconfig
If you installed a shared library and also modify
LD_LIBRARY_PATH (or equivalent) environment variable.
This means you need to set the environment variable LD_LIBRAY_PATH (the environment variable is used to tell the system to find the path to which the wxWidgets development library should be located. Because the logic of the operating system is that if I don't find what I want in the path I think I want to go to, I will think that things have been installed ), do not close the terminal opened in this stride.
Ii. Set the environment variable LD_LIBRAY_PATH
Reference link:
- Ldconfig and LD_LIBRARY_PATH
- Modify and set Linux environment variables
- Linux export command
Based on the prompt information obtained at the end of the previous step and comprehensive references, we will perform the following operations,
1. If the terminal is still opened in step 1 without changing the directory, enter the following command:
Ldconfig (this is based entirely on the last prompt of step 1)
Export-p (view the value of the current environment variable of the system. This step is only used to compare with the set effect, which can be omitted)
As you can see, the value of LD_LIBRAY_PATH is null (This item does not exist in the result ).
2. Continue to enter the command:
./Wx-config -- libs
Result (the installation directory varies slightly ):
-L/root/Desktop/wxWidgets-2.8.12/lib-pthread-Wl,-rpath, /root/Desktop/wxWidgets-2.8.12/lib-lwx_gtk2_richtext-2.8-lwx_gtk2_aui-2.8-lwx_gtk2_xrc-2.8-lwx_gtk2_qa-2.8-lwx_gtk2_html-2.8-lwx_gtk2_adv-2.8-lwx_gtk2_core-2.8-lwx_base_xml-2.8-lwx_base_net-2.8
3. Find the File profile in the/etc directory, open it, and add the following command in it:
Export LD_LIBRARY_PATH = "............ "
The content in the quotation marks is the execution result of the previous small step "./wx-config -- libs. The export command is used to edit environment variables. If you do not know the location to add, find another export command in the file and follow it. Save the profile file.
4. Run the following command on the terminal:
Source/etc/profile (takes effect without restarting the system)
Export-p (view the value of the current environment variable of the system)
This time, we can see that the value of LD_LIBRAY_PATH is successfully set to the execution result of "./wx-config -- libs" in step 2nd.
3. Install codeblocks
1. Download codeblocks source package, address: http://www.codeblocks.org/downloads/
2. decompress the package.
3. Enter the decompressed directory, open the new terminal, and enter the following commands in sequence
./Configure -- prefix =/usr/local/codeblocks (the prefix parameter is used to specify the installation path. If you skip the second step, you will be prompted that wxWidgets is not installed)
Make (compile. Well, let's continue fighting for landlords ......)
Make install (installation .)
OK. Now, Code: Blocks is successfully installed. Open the terminal in any directory and run the codeblocks command to run Code: Blocks.
Iv. codeblocks
1. Download the Chinese package of codeblocks. Address:
Free in http://linux.bkjia.com/
The username and password are both www.bkjia.com
The specific download directory is available at/July 15,/July 5/July 5/Hadoop fair scheduler guide PDF
For the download method, see
2. in the/usr/share/or/usr/local/share/directory (see how you specify the prefix parameter in the third step) find the codeblocks directory (including icons, images, lexers, scripts, and other resource directories and some compressed packages), and create a sub-Folder: locale (note that all locale are lowercase letters ). If not, see Step 3. Otherwise, go to step 4.
3. Open the terminal on the desktop and run the command: locate codeblocks> codeblocks. After running, a file named codeblocks is generated on the desktop. open the file and find the path of the codeblocks directory.
4. decompress the downloaded compressed package to the locale directory created in step 1. The zh_CN subdirectory appears under the locale Directory, which contains a file named codeblocks.mo.
5. Start Code: Blocks. Click "Settings" in the main menu and select "Enviornment ". In the displayed dialog box, select "View" on the left, check "Internationalization (needs restart)" on the right, and select "Chinese (Simplified)" in the composite box )". Confirm to exit this dialog box.
6. Restart Code: Blocks. The Simplified Chinese interface is displayed.
Main tangle Problems
1. A set of rpm packages was first launched, and then the package dependency problem occurred when libtinyxml0 was installed in the fourth package:
Error: Failed dependencies:
Libstdc ++. so.6 (GLIBCXX_3.4.9) is needed by libtinyxml0-2.6.1-9.1.2.i586
Rpmlib (PayloadIsLzma) <= 4.4.6-1 is needed by libtinyxml0-2.6.1-9.1.2.i586
This problem has plagued me for a long time. I searched a lot of documents and found that all of them have been solved. I finally gave up. Please leave me a message if you know what to do. Thank you!
According to the resource uploader, the test passes in OpenSUSE Linux. If you also use this system, you can go to this link to see:
2. Based on the information, I installed codeblocks directly after wxWidgets. As a result, the terminal reports an error,
Configure: error:
WxWidgets must be installed on your system
But the wx-config script couldn't be found.
Please check that wx-config is in path, the directory
Where wxWidgets libraries are installed (returned
'Wx-config -- libs' command) is in LD_LIBRARY_PATH or
Equivalent variable and wxWidgets version is 2.8.0 or above.
But I have settled wxwidgets! I found a lot of information and tried a lot of methods to solve the problem. Later, I carefully read the prompt message after wxwidgets is successfully installed, and compared it with the error message of codeblocks installation initialization, I finally found the crux of the problem: environment variable settings.
Basically, I did not mention this question for all the information I have seen, but it is really important. As a result, I came to the conclusion that there are a lot of online materials, and there are also a lot of step-by-step problems. If you want to make it easier, see the system prompts.
Good luck
1./etc/ld. so. conf
This document records the path of the dynamic link library used during compilation. By default, the compiler only uses the library documents under the/lib and/usr/lib directories. If you want to add anything other than the preceding two directories, in the etc/ld. so. conf. add a conf file under the d directory, add the new path, and then call ldconfig.
There are also some documents that, if you want to add something outside the above two directories, you must modify the/etc/ld. so. conf file, otherwise the system will not find the new library. After reading it, I became confused. Then I opened the ld. so. conf file, which contains the following content:
Include ld. so. conf. d/*. conf
After reading it, I suddenly understood it.
2. wxWidgets and wxGTK
Wxwidgets is a framework written in c ++ to provide gui development. It contains a GUI library that supports almost all operating systems today. WxGTK is applicable to Linux systems, and wxMSW is used in Windows systems.
3. When using the tar command, the compressed package cannot contain "(" or other invalid symbols.
Code: Blocks detailed introduction: click here
Code: Blocks's: click here
For the installation Code: Block in Ubuntu 12.04, see