(OK) CentOS7 installation Codeblocks

Source: Internet
Author: User
Tags bz2 wxwidgets
Reference: http://www.centoscn.com/image-text/install/2014/0905/3684.html

The process of installing codelocks on CentOS7.

1. Install GCC, need C and C + + two parts, the default installation, CentOS do not install the compiler, in the terminal input the following command
Yum Install GCC
Yum Install gcc-c++

2. Install Gtk2-devel, because the support library for the formal product is installed by default, but the documentation required for development is not installed.
Yum Install gtk2*

3. Install WXGTK (or wxwidgets), download the address: http://www.wxwidgets.org/downloads/, download the file as: wxwidgets-3.0.2.tar.bz2,

After decompression, execute command after entering directory

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

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 the
Ld_library_path (or equivalent) environment variable.

WxWidgets comes with no guarantees and doesn ' t claim
To is suitable for any purpose.

Read the wxwindows Licence on licencing conditions.

------------------------------------------------------

Ldconfig


4. Install codeblocks, download codeblocks installation package, download address: http://www.codeblocks.org/downloads/

There are two ways to install this:

The first way is to download the RPM package directly, you can install directly, but the RPM installation form, there is no default installation visual design Wxsmith.

The second way is to download the source code package, suffix. tar.gz (. tar.bz2), after downloading, unzip, enter the directory, execute the command

./configure--prefix=/codeblocks--with-contrib-plugins=all
(if it's just./configure) The default is not to install the visual design Wssmith, if you do not need a graphical interface development, you can directly use the first installation method.
-------------------------------------------------------------------------------
Checking for GTK2 ... yes
Checking for gamin ... no
Configure:error:Package requirements (gamin) were not met:

No package ' gamin ' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
Installed software in a non-standard prefix.

Alternatively, you may set the environment variables Gamin_cflags
and gamin_libs to avoid the need to call Pkg-config.
The Pkg-config man page is for more details.
-------------------------------------------------------------------------------
How to solve the above problem: Yum install gamin*

Make-j5
Make install

[Root@localhost bin]# pwd
/codeblocks/bin
[Root@localhost bin]#./codeblocks
./codeblocks:error while loading shared libraries:libwx_gtk2u-3.0.so.0:cannot open Shared object file:no such file or Directory
----------------------------------------
Vim/etc/ld.so.conf
Last line add:/usr/local/lib
Save exit, then run Ldconfig.
----------------------------------------


[Root@localhost bin]# ln-s/codeblocks/bin/codeblocks/root/Desktop/codeblocks



+++++++++++++++++++++++++++++++ below for reference

5. After installing the Codeblocks, the Programming menu item will appear under Application, where the codeblocks can be started.


6. Install Xterm:yum Install Xterm

7. If you do not see the Codeblocks menu item, you can: Create a desktop launcher as follows:


1, click the application--system Tools
2. Select "Launch Application"
3. Select "Add" in Startup program preferences
4, will appear as before the Add Launcher dialog box, to set
5, after setting the name and command (path), click "Add", the initiator is added to the list
6, with the mouse to select just add the initiator, drag it to the desktop
7. Right-click the new Starter, select Properties, check in the Permissions tab--execute: Allow program execution files
8, the above step, in the Basic tab click on the icon, you can set the Launcher desktop icon.


+++++++++++++++++++++++++++++++, don't look underneath.


++++++++++++++++++ installation Wxwidgets

[Root@localhost wxwidgets-3.0.2]# pwd
/opt/wxwidgets-3.0.2
[Root@localhost wxwidgets-3.0.2]#./configure--prefix=/opt/wxwidgets--ENABLE-XRC--enable-monolithic-- Enable-unicode
[Root@localhost wxwidgets-3.0.2]# Make-j5
[Root@localhost wxwidgets-3.0.2]# make install


++++++++++++++++++ installation Codeblocks

[Root@localhost codeblocks-13.12]#./configure--prefix=/opt/codeblocks ldflags= "-wl,-r/opt/wxwidgets/lib" With-wx-config=/opt/wxwidgets/bin/wx-config
[Root@localhost codeblocks-13.12]# Make-j5
[Root@localhost codeblocks-13.12]# make install

[Root@localhost codeblocks-13.12]#/opt/codeblocks/bin/codeblocks
The following error occurred:
Codeblocks:error while loading shared Libraries:libwx_gtk2u-3.0.so.0:cannot open Shared object file
Add a line to the end of/etc/ld.so.conf:/opt/wxwidgets/lib/,
After saving, run again:/sbin/ldconfig-v can

[Root@localhost codeblocks-13.12]# ln-s/opt/codeblocks/bin/codeblocks/root/Desktop/codeblocks


++++++++++++++++++ under the useless

Operating system: CentOS 5.2
Development library: wxWidgets-2.8.12
Software version: codeblocks-10.05

I. Installation of wxwidgets

./configure preferably do not add prefix parameters, using the default settings will be more conducive to the smooth progress of the later steps.
Make-j5
Make install

Second, set the environment variable Ld_libray_path

1. Still in the first stride open the terminal, do not change the directory, enter the following command:
Ldconfig (this is entirely based on the last hint of the first step)
Export-p (View the value of the system's current environment variable, which is only to be compared to the effect set and can be omitted)
You can see now that the value of the Ld_libray_path is empty (there is no such item in the result).
2. Continue to enter the command:
./wx-config--libs
Results (there will be small differences in the installation directory for different results):
-l/opt/wxwidgets-3.0.2/lib-pthread-wl,-rpath,/opt/wxwidgets-3.0.2/lib-lwx_gtk2u-3.0

3. Locate the file profile in the/etc directory, open it, and add the following command inside:
Export Ld_library_path= "..... ..."
The quotation marks are the result of the previous small step "./wx-config--libs". The Export command is used to edit the environment variable, and if you don't know where to add it, please find another export command in the file, followed by him. Save the profile file.

4. Or in front of the open terminal, continue to enter the command:
Source/etc/profile (To make profile modification effective without rebooting the system)
Export-p (View the value of the system's current environment variable)
As you can see, the value of Ld_libray_path is successfully set as the result of the 2nd small step "./wx-config--libs".

Iii. installation of Codeblocks

./configure--prefix=/opt/codeblocks (prefix parameter is used to specify the installation path)
Make-j5
Make install

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[Root@localhost wxwidgets-3.0.2]# pwd
/opt/wxwidgets-3.0.2
[Root@localhost wxwidgets-3.0.2]#./configure--prefix=/opt/wxwidgets--ENABLE-XRC--enable-monolithic-- Enable-unicode
[Root@localhost wxwidgets-3.0.2]# Make-j5
[Root@localhost wxwidgets-3.0.2]# make install



Export ldflags= "-wl,-r/opt/wxwidgets/lib"
./configure--prefix=/opt/codeblocks--with-wx-config=/opt/wxwidgets-3.0.2/bin/wx-config
Make-j5
Make install

[Root@localhost codeblocks-13.12]#./bootstrap
./configure--prefix=/opt/codeblocks ldflags= "-wl,-r/opt/wxwidgets/lib"--with-wx-config=/opt/wxwidgets/bin/ Wx-config
Make-j5
Make install


A alternative solution (untested) according to comments would is:

$./configure ldflags= "-wl,-r/path/to/wxgtk/lib" # Other Configure flags omitted
$ make
$ make Install


Http://stackoverflow.com/questions/2203946/error-while-loading-shared-libraries

++++++++++++++++++
In/etc/ld.so.conf, add/usr/local/lib this line, save, then run:/sbin/ldconfig–v update configuration can be


./configure--prefix=/opt/codeblocks ldflags= "-wl,-r/opt/wxwidgets/lib"--with-wx-config=/opt/wxwidgets/bin/ Wx-config
Make-j5
Make install

./configure--prefix=/opt/codeblocks--with-contrib-plugins=all
(if it's just./configure) The default is not to install the visual design Wssmith, if you do not need a graphical interface development, you can directly use the first installation method.
Make-j5
Make install
++++++++++++++++++

[Root@localhost codeblocks-13.12]#/opt/wxwidgets/bin/wx-config--prefix
/opt/wxwidgets
[Root@localhost codeblocks-13.12]#/opt/wxwidgets/bin/wx-config--libs
-l/opt/wxwidgets/lib-pthread-lwx_gtk2u_xrc-3.0-lwx_gtk2u_html-3.0-lwx_gtk2u_qa-3.0-lwx_gtk2u_adv-3.0-lwx_gtk2u _core-3.0-lwx_baseu_xml-3.0-lwx_baseu_net-3.0-lwx_baseu-3.0
[Root@localhost codeblocks-13.12]#./bootstrap
Found revision: ' 0 '
libtoolize:putting auxiliary files in '. '.
libtoolize:copying file './ltmain.sh '
libtoolize:putting macros in Ac_config_macro_dir, ' M4 '.
libtoolize:copying file ' m4/libtool.m4 '
libtoolize:copying file ' m4/ltoptions.m4 '
libtoolize:copying file ' m4/ltsugar.m4 '
libtoolize:copying file ' m4/ltversion.m4 '
libtoolize:copying file ' m4/lt~obsolete.m4 '
Configure.ac:86:warning:macro ' am_options_wxconfig ' not found in library
Configure.ac:87:warning:macro ' am_path_wxconfig ' not found in library
configure.ac:86:error:possibly undefined Macro:am_options_wxconfig
If This is token and others are legitimate, please use M4_pattern_allow.
The autoconf documentation.
configure.ac:87:error:possibly undefined Macro:am_path_wxconfig
[Root@localhost codeblocks-13.12]# find/opt/-name wxwin.m4
^c
[Root@localhost codeblocks-13.12]# find/opt/wxwidgets*-name wxwin.m4
/opt/wxwidgets/share/aclocal/wxwin.m4
/opt/wxwidgets-3.0.2/wxwin.m4
[Root@localhost codeblocks-13.12]# cp/opt/wxwidgets-3.0.2/wxwin.m4/usr/share/aclocal
aclocal/aclocal-1.13/
[Root@localhost codeblocks-13.12]# cp/opt/wxwidgets-3.0.2/wxwin.m4/usr/share/aclocal
[Root@localhost codeblocks-13.12]#./bootstrap
Found revision: ' 0 '
libtoolize:putting auxiliary files in '. '.
libtoolize:copying file './ltmain.sh '
libtoolize:putting macros in Ac_config_macro_dir, ' M4 '.
libtoolize:copying file ' m4/libtool.m4 '
libtoolize:copying file ' m4/ltoptions.m4 '
libtoolize:copying file ' m4/ltsugar.m4 '
libtoolize:copying file ' m4/ltversion.m4 '
libtoolize:copying file ' m4/lt~obsolete.m4 '
[Root@localhost codeblocks-13.12]#



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.