ubuntu16.04编译redis desktop manager的脚本为
下载并切换目录
git clone --recursive https://github.com/uglide/RedisDesktopManager.git -b 0.8.0 rdm && cd ./rdm编译脚本
cd src/ ./configure source /opt/qt56/bin/qt56-env.sh && qmake && make && sudo make install cd /usr/share/redis-desktop-manager/bin sudo mv qt.conf qt.backup
问题1:RedisDesktopManager下载不全的问题。
解决方法:由于官方提供到git clone命令使用了--recursive参数,这个参数会把git子模块也下载下来。但是子模块里有个google的breakpad,由于google被屏蔽,导致下载不下来,由于这个模块没下载下来,后面到模块也会停止下载。建议去掉--recursive这个参数,然后根据子模块文件.gitmodules里面的内容进行补全,补全时注意大小写和文件名,或者在下载到时候指定分支名称这样就不用再改一次。用官方到命令下载下来到可能也会由空目录,注意检查。
附:.gitmodules里的内容
[submodule "3rdparty/qtconsole"] path = 3rdparty/qtconsole url = https://github.com/uglide/QtConsole.git [submodule "3rdparty/crashreporter"] path = 3rdparty/crashreporter url = https://github.com/RedisDesktop/CrashReporter.git [submodule "3rdparty/easyloggingpp"] path = 3rdparty/easyloggingpp url = https://github.com/easylogging/easyloggingpp.git [submodule "3rdparty/qredisclient"] path = 3rdparty/qredisclient url = https://github.com/uglide/qredisclient.git [submodule "3rdparty/gbreakpad"] path = 3rdparty/gbreakpad url = https://chromium.googlesource.com/breakpad/breakpad [submodule "3rdparty/qgamp"] path = 3rdparty/qgamp url = https://github.com/uglide/qgamp.git [submodule "src/resources/qml/3rdparty/PHP-unserialize-js"] path = src/resources/qml/3rdparty/PHP-unserialize-js url = https://github.com/uglide/PHP-unserialize-js.git
附:很难下载的breakpad,下载之后注意改文件夹的名称:http://download.csdn.net/detail/gsls200808/9685507
问题2:linux-syscall-support头文件无法下载的问题
fatal: unable to access 'https://chromium.googlesource.com/linux-syscall-support/': Failed to connect to chromium.googlesource.com port 443: 连接超时 /home/liyunzhi/rdm/src/..//build/common_functions: 行 13: ./configure: 权限不够 make: *** 没有指明目标并且找不到 makefile。 停止。
In file included from ../3rdparty/gbreakpad/src/client/linux/dump_writer_common/thread_info.h:37:0,from ../3rdparty/gbreakpad/src/client/linux/minidump_writer/linux_dumper.h:51,from ../3rdparty/gbreakpad/src/client/linux/minidump_writer/minidump_writer.h:41,from ../3rdparty/gbreakpad/src/client/linux/handler/exception_handler.h:42,from modules/crashhandler/crashhandler.cpp:11: ../3rdparty/gbreakpad/src/common/memory.h:51:51: fatal error: third_party/lss/linux_syscall_support.h: 没有那个文件或目录 #include "third_party/lss/linux_syscall_support.h" ^ compilation terminated. Makefile:11493: recipe for target '../bin/linux/release/obj/crashhandler.o' Failed make: *** [../bin/linux/release/obj/crashhandler.o] Error 1
解决方法:去这里下载:http://download.csdn.net/detail/gsls200808/9685972,解压后先在rdm/3rdparty/gbreakpad/src/third_party目录下创建lls目录,然后复制linux_syscall_support.h到lls目录下,笔者走了很多弯路,一开始从mongodb的源码里拷贝了一个同名文件放进去,结果很多错误没法解决
这个文件到官方下载地址是google,附原下载命令
git clone https://chromium.googlesource.com/linux-syscall-support
问题3:rdm.qrc找不到PHPUnserialize.js这个文件
RCC: Error in 'resources/rdm.qrc': Cannot find file 'qml/3rdparty/PHP-unserialize-js/PHPUnserialize.js' /opt/qt56/bin/rcc -name rdm resources/rdm.qrc -o ../bin/linux/release/obj/qrc_rdm.cpp RCC: Error in 'resources/rdm.qrc': Cannot find file 'qml/3rdparty/PHP-unserialize-js/PHPUnserialize.js' Makefile:753: recipe for target '../bin/linux/release/obj/qrc_rdm.cpp' Failed make: *** [../bin/linux/release/obj/qrc_rdm.cpp] Error 1
解决方法:从github上下载这个文件,然后覆盖掉里面的qml/3rdparty/(完整路径:rdm/src/resources/qml/3rdparty/)目录下的PHP-unserialize-js文件夹即可
下载命令如下
git clone https://github.com/uglide/PHP-unserialize-js.git
3.编译时提示缺少libbreakpad_client.a
g++: error: /home/liyunzhi/rdm/3rdparty/gbreakpad/src/client/linux/libbreakpad_client.a: 没有那个文件或目录 Makefile:472: recipe for target '../bin/linux/release/rdm' Failed make: *** [../bin/linux/release/rdm] Error 1
解决方法:linux/libbreakpad_client.a这个文件需要编译才能生成,切换gbreakpad目录编译即可
4.从其他地方下载的configure不能执行的问题
相关报错:
./autotools/depcomp: 行 3: $'\r': 未找到命令可能情况1:缺少权限,执行命令 sudo chmod 777 configure
可能情况2:windows的git安装时按照默认情况安装出现换行符转换问题,需要先从dos格式转成unix格式,命令如下
先安装vim,执行如下命令
vim configure :set fileformat=unix :write :set ff=unix :write或者先安装dos2unix执行命令
dos2unix configure其它可能需要转换到文件是config.guess config.sub depcomp
下面是linux-syscall-support头文件不正确的报错,算低级错误了,忽略这一段吧
src/client/linux/crash_generation/crash_generation_client.cc:56:25: error: aggregate ‘google_breakpad::{anonymous}::CrashGenerationClientImpl::RequestDump(const void*,size_t)::kernel_iovec iov’ has incomplete type and cannot be defined struct kernel_iovec iov; ^ src/client/linux/crash_generation/crash_generation_client.cc:60:26: error: variable ‘google_breakpad::{anonymous}::CrashGenerationClientImpl::RequestDump(const void*,size_t)::kernel_msghdr msg’ has initializer but incomplete type struct kernel_msghdr msg = { 0 }; ^ In file included from src/client/linux/crash_generation/crash_generation_client.cc:37:0: src/client/linux/crash_generation/crash_generation_client.cc:74:63: error: ‘sys_sendmsg’ was not declared in this scope ssize_t ret = HANDLE_EINTR(sys_sendmsg(server_fd_,&msg,0)); 查找发现类似的结构体和系统函数是#include <sys/uio.h>的iovec,<sys/socket.h>的msghdr和sendmsg 将kernel_iovec改为iovec,kernel_msghdr改为msghdr,sys_sendmsg改为sendmsg重新编译 src/client/linux/handler/exception_handler.cc: In member function ‘bool google_breakpad::ExceptionHandler::HandleSignal(int,siginfo_t*,void*)’: src/client/linux/handler/exception_handler.cc:436:42: error: too many arguments to function ‘int sys_prctl(int,long int)’ sys_prctl(PR_SET_DUMPABLE,1,0); 在436,535和647行,提示提示太多参数,给出到函数只能传两个,那就去掉3个0呗,sys_prctl(PR_SET_DUMPABLE,0);改成sys_prctl(PR_SET_DUMPABLE,1); ./src/client/linux/minidump_writer/directory_reader.h:67:57: error: ‘sys_getdents’ was not declared in this scope const int n = sys_getdents(fd_,dent,sizeof(buf_)); 去掉sys_ ./src/client/linux/minidump_writer/directory_reader.h:67:57: error: ‘sys_getdents’ was not declared in this scope const int n = sys_getdents(fd_,sizeof(buf_)); 没有定义 include后,define之前加 #include <linux/unistd.h> #include <dirent.h> #include <linux/types.h> #include <sys/stat.h> #include <fcntl.h> #define __NR_getdents 141 long getdents(unsigned int fd,struct linux_dirent __user *dirent,unsigned int count); _syscall3(long,getdents,unsigned int,fd,struct linux_dirent __user *,dirent,count); ./src/client/linux/minidump_writer/directory_reader.h:83:53: error: parameter 2 of ‘long int getdents(unsigned int,linux_dirent)’ has incomplete type ‘linux_dirent’ const int n = getdents(fd_,sizeof(buf_)); 改linux_dirent-->dirent ./src/client/linux/minidump_writer/directory_reader.h:83:53: error: could not convert ‘dent’ from ‘kernel_dirent* const’ to ‘dirent’ const int n = getdents(fd_,sizeof(buf_)); 改所有kernel_dirent-->dirent
启动命令
cd /usr/share/redis-desktop-manager/bin ./rdm附一张截图
附编译过的文件下载:http://download.csdn.net/detail/gsls200808/9686039