Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Ubuntu 安裝 Nox 編譯 make 報錯?升級 Boost 1.55 解決 1.42 版本過舊問題

編輯:關於 Linux

Ubuntu 12.10 預設 Boost 1.42 版本過舊,導致 Nox (OpenFlow 控制器) 編譯失敗 (collect2: ld returned 1 exit status)。解法:安裝建置依賴 (autoconf automake g++ libtool swig make git-core libboost-dev libssl-dev python-twisted ...) → 下載 Boost 1.55 源碼 ./bootstrap.sh --prefix=/usr/local/boost && ./b2 install → ldconfig 刷新庫快取 → 編譯 Nox 指定 --with-boost=/usr/local/boost → make && make install 成功。啟動指令:./nox_core -i ptcp:6633。

關鍵步驟

# 1. 安裝依賴
sudo apt-get install autoconf automake g++ libtool swig make git-core \
  libboost-dev libboost-test-dev libboost-filesystem-dev libssl-dev \
  libpcap-dev python-twisted python-simplejson python-dev
apt-get install libboost-all-dev libttb-dev

# 2. 編譯安裝 Boost 1.55
wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz
tar zxf boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh --prefix=/usr/local/boost
./b2 install
ldconfig

# 3. 編譯 Nox 指定新 Boost
git clone git://github.com/noxrepo/nox
cd nox && ./boot.sh && mkdir build && cd build
../configure --with-boost=/usr/local/boost
make && make install

許多 C++ 專案對 Boost 版本敏感,手動編譯新版並指定路徑是解決系統預設版本過舊的標準做法。

Copyright © Windows教程網 All Rights Reserved