环境信息
linux 4.9.0 debian 9.6.0
下载openpilot源码
sudo apt-get install curl
sudo apt-get install build-essential gdb wget debhelper p7zip-full unzip flex bison
sudo apt-get install libsdl1.2-dev
sudo apt-get install libudev-dev
sudo apt-get install libusb-dev libusb-1.0-0-dev
sudo apt-get install libc6-i386
mkdir -p ~/code
cd ~/code
sudo apt-get install git-core git-doc gitk
git clone https://github.com/openpilot/OpenPilot.git
cd ~/code/OpenPilot
git checkout -b next origin/next
git pull
make all_sdk_install
make all
遇到的问题
问题1:make all_sdk_install中会遇到md5验证错误的问题
解决方法:
手动下载所需软件,并制作md5文件,修改 OpenPilot/make/tools.mk中的下载地址为你本机上的file。
qt的下载地址:http://mirror.bit.edu.cn/qtproject/archive/qt/5.4/5.4.0/qt-opensource-linux-x64-5.4.0.run
Uncrustify下载地址:http://see.sl088.com/wiki/Uncrustify
问题2:all_sdk_install过程中遇到
QSslSocket: cannot resolve CRYPTO_num_locks
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve ERR_free_strings
QSslSocket: cannot resolve EVP_CIPHER_CTX_cleanup
QSslSocket: cannot resolve EVP_CIPHER_CTX_init
QSslSocket: cannot resolve sk_new_null
QSslSocket: cannot resolve sk_push
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSL_get_ex_new_index
QSslSocket: cannot resolve SSLv2_client_method
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv2_server_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot resolve SSLeay_version
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
解决方案:
apt install libssl1.0-dev
https://blog.csdn.net/niutou_ren/article/details/77430224
问题三:make all的过程中,unable to find string literal operator 'operator""fmt' with 'const char [15]'
解决方案:
C++11要求,当字符串跟变量连接的时候,必须fmt前后增加一个空格才行。
'#define show_log(tag, fmt, arg...) printf("[%s][%s:%d]: " fmt "\n", tag, func, LINE, ##arg)
问题四:出现类似tmux: error while loading shared libraries: libQt5Xml.so.5找不到动态库的错误
解决方案:
使用find / -name libQt5Xml.so.5
找到地址后使用export LD_LIBRARY_PATH=your_lib:$LD_LIBRARY_PATH加入类库
https://www.cnblogs.com/SZxiaochun/p/7685499.html
问题五:error: no matching function for call to ‘QTableWidgetItem::setFlags(bool)’
解决方法:
将/OpenPilot/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp
81行 item->setFlags(!Qt::ItemIsSelectable);改成
item->setFlags(objName->flags() & !Qt::ItemIsSelectable);
https://www.qtcentre.org/threads/67784-no-matching-function-for-call-to-QTableWidgetItem-setFlags(bool)
问题六:error: call of overloaded ‘abs(int)’ is ambiguous
解决方法:
将abs改为fabs,并在文件加入include <cstdlib>
http://lib.csdn.net/article/cplusplus/26202
问题七:error: ‘constexpr’ needed for in-class initialization of static data member
解决方案:
这是在结构体内定义double类型需要把const变成constexpr
网友评论