在CentOS下面編譯WizNote Qt Project

編譯環境

  1. CentOS 64位 Desktop 版本:6.5

編譯前的準備:

CentOS的用戶默認沒有root權限,若是當前用戶沒有權限root,則能夠在終端裏面執行下面的命令:c++

su root
sudo sed -i '/root\tALL=(ALL)/a *本身的用戶名*\tALL=(ALL)\tALL' /etc/sudoers
exit
git

須要替換本身的用戶名github

安裝git

sudo yum install gitweb

安裝開發工具

sudo yum groupinstall "Development Tools"ubuntu

安裝開發庫

sudo yum install libX11-devel, libXext-devel, libXtst-devel
sudo yum install libX11-devel libXext-devel libXtst-devel
sudo yum install libXrender-devel
sudo yum install zlib-devel
sudo yum install openssl-devel
sudo yum install flex bison gperf libicu-devel libxslt-devel ruby
sudo yum install libxcb libxcb-devel xcb-util xcb-util-devel
sudo yum install freetype-devel
sudo yum install fontconfig-devel
centos

下載安裝qt 4.8.6

wget http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
tar xvfz qt-everywhere-opensource-src-4.8.6.tar.gz
cd qt-everywhere-opensource-src-4.8.6
./configure -webkit
gmake
sudo gmake install
ruby

注意 在執行 ./configure -webkit 命令的時候,須要確保webkit, ssl,fontconfig,XRender可以被正確編譯,以下: Qt 3 compatibility ..... yes
QtDBus module .......... no
QtConcurrent code ...... yes
QtGui module ........... yes
QtScript module ........ yes
QtScriptTools module ... yes
QtXmlPatterns module ... yes
Phonon module .......... no
Multimedia module ...... auto
SVG module ............. yes
**WebKit module .......... yes**
JavaScriptCore JIT ..... To be decided by JavaScriptCore
Declarative module ..... yes
Declarative debugging ...yes
Support for S60 ........ no
Symbian DEF files ...... no
STL support ............ yes
PCH support ............ yes
MMX/3DNOW/SSE/SSE2/SSE3. yes/yes/yes/yes/yes
SSSE3/SSE4.1/SSE4.2..... yes/yes/yes
AVX..................... yes
Graphics System ........ default
IPv6 support ........... yes
IPv6 ifname support .... yes
getaddrinfo support .... yes
getifaddrs support ..... yes
Accessibility .......... yes
NIS support ............ yes
CUPS support ........... no
Iconv support .......... yes
Glib support ........... no
GStreamer support ...... no
PulseAudio support ..... no
Large File support ..... yes
GIF support ............ plugin
TIFF support ........... plugin (qt)
JPEG support ........... plugin (qt)
PNG support ............ yes (qt)
MNG support ............ plugin (qt)
zlib support ........... system
Session management ..... no
OpenGL support ......... no
OpenVG support ......... no
NAS sound support ...... no
XShape support ......... yes
XVideo support ......... no
XSync support .......... yes
Xinerama support ....... no
Xcursor support ........ no
Xfixes support ......... no
Xrandr support ......... no
**Xrender support ........ yes**
Xi support ............. no
MIT-SHM support ........ yes
**FontConfig support ..... yes**
XKB Support ............ yes
immodule support ....... yes
GTK theme support ...... no
SQLite support ......... plugin (qt)
**OpenSSL support ........ yes (run-time)**
Alsa support ........... no
ICD support ............ no
libICU support ......... yes
Use system proxies ..... no
若是上面幾個顯示的是no,那麼請從新安裝前面的開發庫。 QT編譯耗時很長,請慢慢等待。ide

編譯安裝cmake

由於CentOS自帶的cmake(或者經過rpm安裝的cmake)版本比較低,所以須要本身編譯安裝。 wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
tar -zxv -f cmake-2.8.12.2.tar.gz
cd cmake-2.8.12.2
./configure
gmake
sudo make install
工具

下載編譯WizNote

git clone https://github.com/WizTeam/WizQTClient.git
cd WizQTClient
git checkout testing
./centos-package.sh
開發工具

若是沒有錯誤,則會在WizQTClient同級目錄下面,生成一個WizNote文件夾,進入後能夠執行bin/wiznote來運行WizNote。

安裝QtCreator

注意:若是您不須要開發,則不須要安裝QtCreator便可。若是須要開發調試,能夠安裝。

由於CentOS上面的libstdc++.so.6 版本過低,所以還須要編譯安裝gcc才能夠正確運行QtCreator。

首先,從qt-project.org 下載QtCreator而且安裝。安裝後運行QtCreator,一般會提示有些插件沒法加載,從而致使沒法正常打開工程。咱們須要編譯gcc。

編譯安裝gcc

配置過程當中須要聯網安裝須要的依賴。

wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.1/gcc-4.8.1.tar.bz2
tar -jxvf gcc-4.8.1.tar.bz2
cd gcc-4.8.1
./contrib/download_prerequisites
cd ..
mkdir gcc-build-4.8.1
cd gcc-build-4.8.1
../gcc-4.8.1/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
sudo make install

到這裏能夠編譯並安裝最新版本的gcc。可是由於系統裏面的libstdc++.so.6在 /usr/lib64 裏面,而咱們安裝的在 /usr/local/lib64裏面,所以須要更新一下連接。

sudo rm /usr/lib64/libstdc++.so.6
sudo ln -s /usr/local/lib64/libstdc++.so.6.0.18 /usr/lib64/libstdc++.so.6

而後從新打開QtCreator,就能夠正常運行了。

最後,咱們本身編譯的qt library在/usr/local/Trolltech/Qt-4.8.5 裏面,須要在QtCreator選項裏面指定。

若是使用QtCreator打開WizNote工程並編譯,請參考文章:在Ubuntu下面編譯WizNote Qt Project

相關文章
相關標籤/搜索