{"id":804,"date":"2019-10-15T16:07:56","date_gmt":"2019-10-15T08:07:56","guid":{"rendered":"http:\/\/iqotom.com\/?p=804"},"modified":"2019-10-19T16:55:31","modified_gmt":"2019-10-19T08:55:31","slug":"ubuntu%e4%b8%8b%e4%bd%bf%e7%94%a8linuxdeployat%e6%89%93%e5%8c%85%e5%8f%91%e5%b8%83%e5%85%8d%e5%ae%89%e8%a3%85%e7%9a%84qt%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"http:\/\/iqotom.com\/?p=804","title":{"rendered":"Ubuntu\u4e0b\u4f7f\u7528linuxdeployat\u6253\u5305\u53d1\u5e03\u514d\u5b89\u88c5\u7684Qt\u7a0b\u5e8f"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u5f00\u53d1\u73af\u5883<\/h3>\n\n\n\n<p><a href=\"http:\/\/www.qotom.com\/product\/59.html\">QOTOM Q350P<\/a>  \u5de5\u63a7\u7535\u8111<br>\u7cfb\u7edf\u7248\u672c\uff1aUbuntu18.04 LTS<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0b\u8f7d<strong>linuxdeployqt<\/strong><\/h3>\n\n\n\n<p>\u4f20\u9001\u95e8\uff1a <a href=\"https:\/\/github.com\/probonopd\/linuxdeployqt\/releases\">https:\/\/github.com\/probonopd\/linuxdeployqt\/releases<\/a> <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"354\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/linuxdeployqt.png\" alt=\"\" class=\"wp-image-805\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/linuxdeployqt.png?v=1585628001 847w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/linuxdeployqt-300x125.png?v=1585628001 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/linuxdeployqt-768x321.png?v=1585628001 768w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/linuxdeployqt-660x276.png?v=1585628001 660w\" sizes=\"(max-width: 847px) 100vw, 847px\" \/><figcaption>linuxdeployqt github<\/figcaption><\/figure><\/div>\n\n\n\n<p> \u6253\u5305\u524d\u5148\u7528QT\u7f16\u8bd1\u51fareleases\u7a0b\u5e8f\uff0c\u6bd4\u5982\u6211\u7684\u76ee\u5f55\uff1a <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/zdisk\/qt-project\/build-GPIO-TEST-Desktop_Qt_5_7_0_GCC_64bit-Release<\/code><\/pre>\n\n\n\n<p> \u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u5c06\u7f16\u8bd1\u51fa\u7684\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u6587\u4ef6\u653e\u8fdb\u6765\uff0c\u7136\u540e\u5f00\u59cb\u8fdb\u884c\u4e0b\u9762\u7684\u6253\u5305\u64cd\u4f5c <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u4e00\u79cd\u65b9\u6cd5<\/h2>\n\n\n\n<p> \u4e0b\u8f7d<strong>linuxdeployqt-6-x86_64.AppImage<\/strong> \u653e\u5230<code>\/usr\/local\/bin<\/code>\uff0c\u5e76\u8d4b\u4e88777\u6743\u9650 <br><code> chmod 777 linuxdeployqt-6-x86_64.AppImage <\/code><\/p>\n\n\n\n<p> \u628aqmake\u7684\u8def\u5f84\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u4e2d <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/profile\n\u672b\u5c3e\u6dfb\u52a0\uff1aexport PATH=\/opt\/Qt5.7.0\/5.7\/gcc_64\/bin:$PATH<\/code><\/pre>\n\n\n\n<p> \u5982\u679cappname\u662f\u4f60\u7684\u7a0b\u5e8f\uff0c\u6267\u884c\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>linuxdeployqt-continuous-x86_64.AppImage appname -appimage<\/code><\/pre>\n\n\n\n<p> \u7ed3\u679c\u6211\u7684<strong>ubuntu<\/strong>\u7248\u672c\u592a\u9ad8\uff0c\u7f16\u8bd1\u5931\u8d25\u4e86\uff0c\u5e94\u8be5\u662f\u4e3a\u4e86\u517c\u5bb9\u6027\u6545\u610f\u8bbe\u8ba1\u7684 \uff0c\u8fd9\u4e2a\u65b9\u6cd5\u5efa\u8bae\u4f4e\u7248\u672c\u7684\u4f7f\u7528\uff0c\u5931\u8d25\u65e5\u5fd7\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR: The host system is too new.\nPlease run on a system with a glibc version no newer than what comes with the oldest.\nstill-supported mainstream distribution, which currently is glibc 2.20.\nThis is so that the resulting bundle will work on most still-supported Linux distributions.\nFor more information, please see\nhttps:\/\/github.com\/probonopd\/linuxdeployqt\/issues\/340<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7b2c\u4e8c\u79cd\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u4fee\u6539 linuxdeployqt \u6e90\u4ee3\u7801\u540e\u6253\u5305<\/p>\n\n\n\n<p>1. \u4e0b\u8f7d\u6e90\u7801Source code.tar.gz <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/home\/laohu\/downloads\/linuxdeployqt-6<\/code><\/pre>\n\n\n\n<p>2. \u914d\u7f6eQT\u73af\u5883\uff0c\u5728~\/.bashrc\u4e2d\u52a0\u5165\uff0c\u6ce8\u610f\u4fee\u6539\u4e3a\u81ea\u5df1\u7684\u8def\u5f84\uff1a <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export PATH=\/opt\/Qt5.7.0\/5.7\/gcc_64\/bin:$PATH\nexport LD_LIBRARY_PATH=\/opt\/Qt5.7.0\/5.7\/gcc_64\/lib:$LD_LIBRARY_PATH\nexport QT_PLUGIN_PATH=\/opt\/Qt5.7.0\/5.7\/gcc_64\/plugins:$QT_PLUGIN_PATH\nexport QML2_IMPORT_PATH=\/opt\/Qt5.7.0\/5.7\/gcc_64\/qml:$QML2_IMPORT_PATH<\/code><\/pre>\n\n\n\n<p>3. \u4fee\u6539linuxdeployqt\u6e90\u4ee3\u7801 <br> \u4e3a\u4e86\u907f\u514d\u7f16\u8bd1\u597d\u7684\u5305\u8fd0\u884c\u65f6\u68c0\u6d4b\u5230\u6211\u4eec\u7684\u7cfb\u7edf\u7248\u672c\u8fc7\u9ad8\uff0c\u4e0d\u7ee7\u7eed\u6267\u884c\u7684\u95ee\u9898\uff0c\u6211\u4eec\u7f16\u8bd1\u524d\uff0c\u5c06<code>tools\/linuxdeployqt\/main.cpp<\/code>\u4e2d\u7684\u4e0b\u8ff0\u4ee3\u7801\u6ce8\u91ca\u6389\uff1a <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ openSUSE Leap 15.0 uses glibc 2.26 and is used on OBS\n        \/*if (strverscmp (glcv, \"2.27\") >= 0) {\n            qInfo() &lt;&lt; \"ERROR: The host system is too new.\";\n            qInfo() &lt;&lt; \"Please run on a system with a glibc version no newer than what comes with the oldest\";\n            qInfo() &lt;&lt; \"still-supported mainstream distribution, which currently is glibc 2.20.\";\n            qInfo() &lt;&lt; \"This is so that the resulting bundle will work on most still-supported Linux distributions.\";\n            qInfo() &lt;&lt; \"For more information, please see\";\n            qInfo() &lt;&lt; \"https:\/\/github.com\/probonopd\/linuxdeployqt\/issues\/340\";\n            return 1;\n        }*\/<\/code><\/pre>\n\n\n\n<p>4. \u7f16\u8bd1linuxdeployqt\u6e90\u4ee3\u7801 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@ubuntu:~\/downloads\/linuxdeployqt-6# ls\nBUILDING.md     LICENSE.GPLv3         linuxdeployqt.pro  sync.profile\nCMakeLists.txt  LICENSE.LGPLv3        README.md          tests\nDockerfile      linuxdeployqt.AppDir  src                tools\nroot@ubuntu:~\/downloads\/linuxdeployqt-6# qmake\nInfo: creating stash file \/home\/laohu\/downloads\/linuxdeployqt-6\/.qmake.stash\nInfo: creating cache file \/home\/laohu\/downloads\/linuxdeployqt-6\/.qmake.cache\nroot@ubuntu:~\/downloads\/linuxdeployqt-6# make\n...<\/code><\/pre>\n\n\n\n<p> \u7f16\u8bd1\u51fa\u6765\u7684\u6e90\u7a0b\u5e8f\u4f1a\u653e\u5728<code>.\/bin<\/code>\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u5c06\u751f\u6210\u7684\u7a0b\u5e8f\u653e\u5230<code>\/usr\/local\/bin\/<\/code>\u76ee\u5f55\u4e0b\uff08\u4e3a\u4e86\u65b9\u4fbf\uff09 <\/p>\n\n\n\n<p>5. \u7528linuxdeployqt\u6253\u5305QT\u5e94\u7528 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>linuxdeployqt appname<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6253\u5305\u4e2d\u7684\u9519\u8bef\u89e3\u51b3<\/h2>\n\n\n\n<p><strong>1. \u7f3a\u5c11patchelf <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR: Could not start patchelf.\nERROR: Make sure it is installed on your $PATH.\nERROR: Error reading rpath with patchelf \"libQt5Widgets.so\" : \"\"<\/code><\/pre>\n\n\n\n<p> \u8fd9\u4e2a\u9519\u8bef\u53ea\u8981\u5b89\u88c5pathchelf\u5de5\u5177\u5c31\u53ef\u89e3\u51b3\uff1a <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install patchelf<\/code><\/pre>\n\n\n\n<p><strong>2. \u7f3a\u5c11libjasper.so\u5e93\u6587\u4ef6 <\/strong><br> \u5b89\u88c5libjasper1 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo add-apt-repository \"deb http:\/\/security.ubuntu.com\/ubuntu xenial-security main\"\nsudo apt update\nsudo apt install libjasper1 libjasper-dev<\/code><\/pre>\n\n\n\n<p><strong>3. qmake\u6307\u5411\u7684\u8def\u5f84\u9519\u8bef <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR: \"\/usr\/bin\/qmake -query\" exited with 1 : \"qmake: could not exec '\/usr\/lib\/x86_64-linux-gnu\/qt4\/bin\/qmake': No such file or directory\\n\"\nERROR: Qt path could not be determined from qmake on the $PATH\nERROR: Make sure you have the correct Qt on your $PATH\nERROR: You can check this with qmake -v\n\nvim \/usr\/lib\/x86_64-linux-gnu\/qt-default\/qtchooser\/default.conf\n\u5c06\u7b2c\u4e00\u53e5\u4fee\u6539\u4e3a \/opt\/Qt5.7.0\/5.7\/gcc_64\/bin<\/code><\/pre>\n\n\n\n<p><strong>4. linuxdeployqt\u6253\u5305\uff0c\u6bd4\u5982\u6211\u7684\u7a0b\u5e8f\u53ebGPIO-TEST <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@ubuntu:\/zdisk\/gpio_test# linuxdeployqt GPIO-TEST\n\u4f1a\u751f\u6210\u4e0b\u5217\u6587\u4ef6\nroot@ubuntu:\/zdisk\/gpio_test# ls\nAppRun  GPIO-TEST  lib  plugins  qt.conf  translations<\/code><\/pre>\n\n\n\n<p> \u5c06\u6587\u4ef6\u5939\u6253\u5305\u5230\u5176\u4ed6\u7535\u8111\uff0c\u6267\u884c.\/AppRun \u548c .\/GPIO-TEST\u90fd\u53ef\u4ee5\u6267\u884c\u4e86 <\/p>\n\n\n\n<p>\n\n\u53c2\u8003\uff1a<a href=\"https:\/\/www.jb51.net\/article\/164480.htm\">https:\/\/www.jb51.net\/article\/164480.htm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f00\u53d1\u73af\u5883 QOTOM Q350P \u5de5\u63a7\u7535\u8111\u7cfb\u7edf\u7248\u672c\uff1aUbuntu18.04 LTS \u4e0b\u8f7dlinuxdeploy\u2026 <span class=\"read-more\"><a href=\"http:\/\/iqotom.com\/?p=804\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":808,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,49,81],"tags":[74,50,73],"_links":{"self":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/804"}],"collection":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=804"}],"version-history":[{"count":3,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/804\/revisions"}],"predecessor-version":[{"id":809,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/804\/revisions\/809"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/media\/808"}],"wp:attachment":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=804"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}