Ubuntu WizNote安装最全错误集锦

http://blog.csdn.net/jitao10/article/details/56285044

  • 下载WizNote的源代码
    • 创建目录
    • 安装git工具
    • 下载源代码
  • Linux下编译为知云笔记
    • 安装QT
    • 安装cmake
    • 安装zlib
    • 编译源代码
      • 常见错误 No CMAKE_CXX_COMPILER could be found
      • 常见错误Failed to find GLglh
      • 常见错误QLocalSocketconnectToServer Connection refused闪退
      • 常见错误Could not find a package configuration file provided by Qt5WebEngine
    • 编译成功
  • 安装后的启动

下载WizNote的源代码

创建目录

cd ~
mkdir wizhi

安装git工具

# ubuntu/debian
apt-get install git -t
# rhel/centos/fedora
yum install git -y
# opensuse
zypper in git -y

下载源代码

git clone https://github.com/WizTeam/WizQTClient.git
这里写图片描述

下载比较慢耐心等待

Linux下编译为知云笔记

安装QT

wget http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-linux-x64-5.7.0.run
xhost +
su - root
# 输入您的root passwd
./qt-opensource-linux-x64-5.7.0.run
# 执行安装过程并且等待完成

安装cmake

# ubuntu/debian
sudo apt-get install cmake -y
# rhel/centos/fedora
yum install cmake -y
# opensuse
zypper in cmake -y

安装zlib

# ubuntu/debian
sudo apt-get install zlib1g-dev -y
# rhcl/centos/fedora
yum install zlib-dev -y
# opensuse 
zypper in zlib-devel

编译源代码

# 进入到当前目录下的WizQTClient
cd ./WizQTClient
./linux-package.sh
#--------- 正常输出 ----------

常见错误( No CMAKE_CXX_COMPILER could be found)

CMake Error in CMakeLists.txt:
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

解决方法:

# 这个问题是没有安装cmake导致的
# ubuntu/debian
sudo apt-get install cmake -y
# rhel/centos/fedora
yum install cmake -y
# opensuse
zypper in cmake -y
# ubuntu:
sudo apt-get install libgl1-mesa-dev 

常见错误(Failed to find “GL/gl.h”)

CMake Error at /opt/Qt/5.7/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
  Failed to find "GL/gl.h" in "/usr/include/libdrm".
解决方法:
# 没有安装GL/GLX development files of the OpenGL API
zypper in Mesa-libGL-devel

常见错误(“QLocalSocket::connectToServer: Connection refused”闪退)

QLocalSocket::connectToServer: Connection refused
...
QSslSocket: cannot call unresolved function
然后程序闪退

解决方法:

# 卸载fcitx-qt5
zypper rm fcitx-qt5
# 重启计算机
# 重新安装 fcitx-qt5
zypper in fcitx-qt5
# 重启计算机
# 重新安装后就好了,原因没有找到
# 其它Linux发行版本,请参考解决思路

常见错误(Could not find a package configuration file provided by “Qt5WebEngine”)

-- Checking to see if CXX compiler accepts flag -fprofile-arcs -ftest-coverage - yes
CMake Warning at /usr/lib64/cmake/Qt5Core/Qt5CoreMacros.cmake:325 (find_package):
  Could not find a package configuration file provided by "Qt5WebEngine" with
  any of the following names:

    Qt5WebEngineConfig.cmake
    qt5webengine-config.cmake

  Add the installation prefix of "Qt5WebEngine" to CMAKE_PREFIX_PATH or set
  "Qt5WebEngine_DIR" to a directory containing one of the above files.  If
  "Qt5WebEngine" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  cmake/QtChooser.cmake:47 (qt5_use_modules)
  lib/quazip/CMakeLists.txt:8 (qt_use_modules)

CMake Error at /usr/lib64/cmake/Qt5Core/Qt5CoreMacros.cmake:327 (message):
  Can not use "WebEngine" module which has not yet been found.
Call Stack (most recent call first):
  cmake/QtChooser.cmake:47 (qt5_use_modules)
  lib/quazip/CMakeLists.txt:8 (qt_use_modules)

-- Configuring incomplete, errors occurred!
See also "/home/tao/learn/wizhi/WizQTClient-Release-Linux/CMakeFiles/CMakeOutput.log".
See also "/home/tao/learn/wizhi/WizQTClient-Release-Linux/CMakeFiles/CMakeError.log".
cp: 无法获取"../../WizQTClient-Release-Linux/bin/WizNote" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"/usr/lib/x86_64-linux-gnu/libQtWebKit.so.4" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"/usr/lib/x86_64-linux-gnu/libQtGui.so.4" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"/usr/lib/x86_64-linux-gnu//libQtXml.so.4" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"/usr/lib/x86_64-linux-gnu/libQtNetwork.so.4" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"/usr/lib/x86_64-linux-gnu/libQtCore.so.4" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"../../../../WizQTClient-Release-Linux/lib/wiznote/plugins/libextensionsystem.so" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"../../../../WizQTClient-Release-Linux/lib/wiznote/plugins/libaggregation.so" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"../../../../WizQTClient-Release-Linux/lib/wiznote/plugins/libCore.so" 的文件状态(stat): 没有那个文件或目录
cp: 无法获取"../WizQTClient-Release-Linux/share" 的文件状态(stat): 没有那个文件或目录
WizNote/
WizNote/bin/
WizNote/lib/
WizNote/lib/wiznote/
WizNote/lib/wiznote/plugins/
WizNote/WizNote

解决方法:

vim CMakeLists.txt
# 添加一行环境变量 看下图第19行
#注意这里的 /opt/Qt/5.7/gcc_64  一定要是自己安装的目录下的. 这里qt安装在 "/opt/Qt/5.7"; 根据自己的安装的目录自行更改
set(CMAKE_PREFIX_PATH "/opt/Qt/5.7/gcc_64")
这里写图片描述

常见错误("error: field 'm_mutex' has incomplete type 'QMutex'”)

error: field 'm_mutex' has incomplete type 'QMutex'

解决方法:

  • 在源码中找到WizKMSync.h文件,加入#include 引用头文件,再编译。解决方案在https://github.com/WizTeam/WizQTClient/issues/483

编译成功

到达100%编译成功

这里写图片描述

安装后的启动

cd ../WizNote
./WizNote 
# 可以运行了吧

你可能感兴趣的:(Ubuntu WizNote安装最全错误集锦)