如何在Debian/Ubuntu/Raspbian 裡compile notepadqq

之前我有分享這篇如何安裝Notepadqq,但今日想要直接編譯我們需要的版本?

答案是可以的,如下步驟:

first needs gcc, g++, and cmake.

sudo apt install cmake

sudo apt install g++

sudo apt install gcc


因為Notepadqq需要Qt5,所以需要先安裝Qt5。打開Terminal 後輸入:

sudo apt-get install qt5-qmake
sudo apt-get install -y libqt5webkit5 libqt5svg5 coreutils
sudo apt-get install -y libqt5webkit5-dev libqt5svg5-dev qttools5-dev-tools
sudo apt-get install libqt5websockets5-dev

接著clone github的Nopadqq的repository

git clone https://github.com/notepadqq/notepadqq.git
cd notepadqq

這是最新版的,如果想要舊版可以去Notepadqq的github的release去下載Notepadqq的zip檔,任何您需要的版本,本文使用Notepadqq 1.4.8Notepadqq_1.2

之後的版本不一定可成功.

設定環境

For 64 bit Debian/Ubuntu

./configure --prefix /usr --qmake /usr/lib/x86_64-linux-gnu/qt5/bin/qmake

For 32 bit Debian/Ubuntu

./configure --prefix /usr --qmake /usr/lib/i386-linux-gnu/qt5/bin/qmake

For Raspbian:

./configure --prefix /usr --qmake /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake


often error will qt5 lack some packages. (2021-05-21 update)

e.g.

checking for QT5 qmake... /usr/lib/x86_64-linux-gnu/qt5/bin/qmake

checking for lrelease... /usr/bin/qtchooser -run-tool=lrelease -qt=5

checking for c++... /usr/bin/c++

checking whether c++ compiler builds test program... ok

checking whether c++ compiler supports -std=c++0x... ok

checking whether compiled test program works... ok

checking for make... /usr/bin/make

checking for pkg-config... /usr/bin/pkg-config

checking for Qt5Core library... -lQt5Core

checking for Qt5Gui library... -lQt5Gui -lQt5Core

checking for Qt5Network library... -lQt5Network -lQt5Core

checking for Qt5WebEngine library... not found!

checking for Qt5Widgets library... -lQt5Widgets -lQt5Gui -lQt5Core

checking for Qt5WebEngineWidgets library... not found!

checking for Qt5PrintSupport library... -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core

checking for Qt5Svg library... -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Core

checking for Qt5WebSockets library... -lQt5WebSockets -lQt5Network -lQt5Core

checking for Qt5WebChannel library... not found!

checking for uchardet library... not found!

generate Makefile... done



if lack uchardet , then in command line input : apt-get install uchardet libuchardet-dev

其他如果有error要修正,如果沒有error.

then Compile the source code and install it.

make
sudo make install

現在在Terminal中輸入Notepadqq就可執行Notepadqq.

Notepadqq的介面如下:





版本:


這就是如何在linux裏面compile Notepadqq程式,

that's it.

留言

這個網誌中的熱門文章

【多益】現點現做的英文怎麼說呢?

《Microsoft Word 應用》:圖片被文字蓋住解決方法,不可設定為固定行高

如何在Ubuntu系統上安裝Notepad ++ (Install Notepad++ On Ubuntu 16.04 / 17.10 / 18.04 / 20.04)