How to install codeblocks in your user directory without root and system file authority
install wxWidgets
- enter wxwidgets website to download the version of Source Code named “Source for Linux,OS X,etc”
- enter the download directory,extract the download file:
tar -jxvf wxWidgets-3.1.0.tar.bz2
- in your user directory,create a wxWidgets bin directory,then enter the wxWidgets decompressed directory,config the working directory:
cd ~
mkdir wxWidget
cd ~/Download/wxWidgets-3.1.0
./configure --prefix=/home/$USER/wxWidget
- then make the install,in the decompressed directory,input:
make
make install
install successful screenshot
set LD_LIBRAY_PATH,because we don’t have the permission to modify the bash_profile,so just input:
setenv PATH ${PATH}:/home/$USER/wxWidget/bin
aclocal too low,install aclocal 1.13
- create the automake and autoconf directory:
cd ~
mkdir autoconf
mkdir automake
- setup the autoconf compnont
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xvzf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure prefix=/home/$USER/autoconf
make
make install
check the version of autoconf,if the version is 2.69,it is OK:
/home/$USER/autoconf -V
-setup the automake compnont
wget http://ftp.gnu.org/gnu/automake/automake-1.13.tar.gz
tar xvzf automake-1.13.tar.gz
cd automake-1.13
setenv PATH /home/$USER/automake/bin:${PATH}
./configure prefix=/home/$USER/automake
make
make install
update autoconf/automake/aclocal
setenv PATH /home/$USER/automake/share/automake-1.13:${PATH}
setenv PATH /home/$USER/automake/share/aclocal-1.13:${PATH}
aclocal
autoreconf
libtoolize
config wxWidget,wxGTK
setenv PATH /home/$USER/wxWidget/bin:${PATH}
setenv PATH /home/$USER/wxWidget/share/aclocal:${PATH}
cp /home/$USER/wxWidget/share/aclocal/wxwin.m4 /home/$USER/automake/share/aclocal
visit the wxWidgets web site,download the wxGTK-2.8.7.tar.gz,then:
tar -zxvf wxGTK-2.8.7.tar.gz
cd wxGTK-2.8.7
mkdir ~/wxGTK
mkdir build_gtk
cd build_gtk
../configure --prefix=/home/$USER/wxWidget --enable-xrc --enable-monolithic --enable-unicode
make
make install
- then check if the configuration is ok.
wx-config --prefix #should give you /home/$USER/wxWidget
wx-config --libs #should have at least: -L/home/$USER/wxWidget/lib -lwx_gtk2-2.8
which wx-config #should return /home/$USER/wxWidget/bin/wx-config
install codeblocks
- enter codeblocks website to download the version of Source Code named “codeblocks_16.01.tar.gz”
- extract the download file:
tar -zxvf codeblocks_16.01.tar.gz
- in your user directory,create a codeblocks bin directory,then enter the codeblocks decompressed directory,config the working directory:
cd ~
mkdir codeblocks
cd ~/Download/codeblocks-16.01.release
##add pkg.m4 path
setenv PATH /home/$USER/automake/share/aclocal:${PATH}
./bootstrap
./configure --prefix=/home/$USER/codeblocks --with-wx-config=/home/$USER/wxWidget/bin/wx-config
the result like this:
compile and setup,input:
make
make install
just like this:
- start the codeblocks,failed:
./codeblocks &
##./codeblocks: error while loading shared libraries: libwx_gtk2u-2.8.so.0: cannot open shared object file: No such file or directory
The problem is that the program cannot find the WX widgets libraries at run time:
##the directory depends on your own,maybe not the same of mine.
setenv LD_LIBRARY_PATH /home/$USER/wxWidget/lib
- then start codeblocks again,got it:
./codeblocks &
tips
Because I don’t have the right to modify the /etc/profile,so here I just use ‘setenv’ command.it is not very well because if you sign out,it doesn’t work.So it is a better way to set the configuration in the ‘.bashrc’ file in your user directory.
some related Links
Installing Code::Blocks from source on Linux
libccls compile problem
安装 Autoconf 2.69版
LD_LIBRARY_PATH: Undefined variable error
Delete a snapshot from cassandra
aclocal-1.14: command not found