How to install C + + compiler code::block__ storage in Linux environment

Source: Internet
Author: User
Tags bz2 wxwidgets

Linux How to install in the environment C + + compiler Code::block

Ann this dongdong a little collapse, whole afternoon. Because of the previous experience of Linux use and development, the first time involved in Linux development, how much feel less comfortable, especially for the installation of various software, compared to Windows does have a lot of trouble.

A few days ago bought a book called "Linux Programming 3rd Edition", is said to be quite classic, the classics certainly cannot miss, especially for a novice who just started to learn Linux. Spent a day and a half time crazy over more than 300 pages, more or less in the heart know what this is talking, feel good, hey ~

The itch began to complete Linux, although said Vim+gcc+gdb has been able to meet the Linux C + + development, but still want to find an IDE as a secondary integrated development environment. Check a lot of blog, it seems that we are also relatively recommended this code::block, summed up the views of some articles, the reasons can be seen from the following:

( 1 Open Source: There is a blog post inside the view that open source Dongdong means free, in fact this is a mistake, open source Dongdong can charge. But open source itself is a good example of the development of a software that is very beneficial to Linux itself.

( 2 Cross-platform: Most programmers who develop in a Linux environment are more or less exposed to program development under the Windows platform (which is almost certainly not the case with Windows pirated discs full of 4 dollars on the street). When you've completed a system under Linux, you're probably subconsciously wondering if it's going to run directly on Windows. So, from this point of view, even if you are designing a system that does not need to consider cross-platform issues, it is certainly not a bad thing to cross the platform for future long-term planning. And like Code::Blocks IDE software can cross Linux and Windows platform, but also can support the Mac system, there is no reason why we should not use it.

( 3 ) IDE itself is used C + + If the IDE you're using is written in Java, like Eclipse, and you have to write a C + + program on it, how would you feel. You know Java virtual machines are written in C + +. - -|||

(4) support multiple compilers: This happy, different compilers for c++99 standard support of different degrees, before using VC6, then a crash ah, Many programs do not work properly, this is good, can choose like GCC, Inter C + +, Borland C + +, VC + +, and so on, I use GCC by default.

( 5 Plug-in framework: reminiscent of Eclipse, a way to keep the IDE well extensible, which is probably the most logical choice for an Open-source IDE. Code::Blocks has a lot of core functions, including debugging functions through Plug-ins to achieve, tomorrow to download a code format to beautify the plug-in to play, and so on, I also want to develop a plug-in, such as what "tank war", loaded into the small game inside, haha.

( 6 Upgrade: Almost every month will be updated, very vitality Dongdong.

( 7 ) Inline visual design: Visual development Platform and VB, Delphi, C + + builder, compared to "fool" on a big cut, the main reason is that the mainstream Cross-platform graphics window Positioning System are used to locate the "container" to achieve, this point may not be too accustomed to the beginning , but it's handy to design a variety of dialog boxes after familiarity. A little less intuitive, but it is easy to let your program migrated to other operating systems, while you know more about the design of the window, it is worthwhile.

( 8 ) C + + Extension Library support: through one of its plug-ins to support Dev C + +, you can download a large number of C + + open source extensions, such as network operations, graphics algorithms, compression, encryption, and so on.

( 9 Multi-national languages: support for nearly 40 languages, but not the default support, Language Pack files can be downloaded after use

( Ten ) The choice of the multitude: Code::Blocks into the "SourceForge Community Choice Award" 2008 Final, "SourceForge" is the world's largest open source community, this event is also known as "Community Best Choice Award", It can be seen that it has a certain scale of user groups, and deeply loved by users.

The summary of the installation process can be divided into the following steps:

1. First to install WXGTK, this is necessary, otherwise code::blocks will not be able to successfully install. Because Code::Blocks is developed based on wxwidgets (WXGTK).

WXGTK Latest version download address: http://www.wxwidgets.org/downloads/

I am using the version download address:

Http://nchc.dl.sourceforge.net/sourceforge/wxwindows/wxGTK-2.8.10.tar.gz

2. Compile and install WXGTK (take wxGTK-2.8.10 as an example)

Enter the following command to install:

Tar zxvf wxgtk-2.8.10.tar.gz

CD wxGTK-2.8.10

./configure--ENABLE-XRC--enable-monolithic--enable-unicode
Make
Make install

The make process time will be quite long, please be patient, if there is no error prompts, the installation is relatively smooth.

3. Download Code::block

Code::block the latest version of the download address: http://www.codeblocks.org/downloads/

I am using the version download address:

http://ncu.dl.sourceforge.net/sourceforge/codeblocks/codeblocks-8.02-src.tar.bz2

4. Compile and install Code::block (take codeblocks-8.02 as an example)

Enter the following command to install:

Tar jxf codeblocks-8.02-src.tar.bz2

CD codeblocks-8.02
./configure–prefix=/usr
Make
Make install

This inside will install it under/usr, if under the/usr/local will hint some so file cannot find, according to Linux custom, the System package is installed in/usr, and the user uses the application software by default installs in/usr/local, if does not specify the word will because path not enough , you cannot include the Lib library, and of course you can add it yourself.

5. Modify the library file path to point to

Because the path was not specified when the WXGTK was installed, the WXGTK was mounted under/usr/local/lib, and, of course, if the path was specified when WXGTK was installed, then this step can be omitted when the "-prefix=/usr" parameter is added.

The library file path points to the method:

Vi/etc/ld.so.conf

At the end of the file enter:/usr/local/lib

After saving, run/sbin/ldconfig

According to the above configuration path should have no problem, otherwise will appear to run Code::Blocks, a flash will automatically shut down, I was this situation, through modification on the solution.

6. Verify that the installation is correct

You can retrieve the correct installation by using the output of the following actions

Wx-config--prefix
Wx-config--libs
Which wx-config<

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.