{"id":330,"date":"2017-06-17T16:51:56","date_gmt":"2017-06-17T15:51:56","guid":{"rendered":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=330"},"modified":"2017-06-17T16:51:56","modified_gmt":"2017-06-17T15:51:56","slug":"update-qt-under-windows","status":"publish","type":"post","link":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=330","title":{"rendered":"Update QT under Windows"},"content":{"rendered":"<p>Well, another lesson in How To Complicate Things &#8482;. Could be as easy as pacman -Syu, run qmake and recompile all, but far from it \ud83d\ude41<\/p>\n<ol>\n<li>Run MaintenanceTool.exe. Of course it has no entry in the start menu, why should it. But it&#8217;s easy to find: C:\\Qt\\MaintenanceTool.exe<\/li>\n<li>Skip the first page, you don&#8217;t need an account. God, how I hate this shit!<\/li>\n<li>On the next page, select &#8220;Add or remove components&#8221;. &#8220;Update components&#8221; will only update your *current* version. To install a *new* version, you have select the first option.<\/li>\n<li>Wait&#8230;<\/li>\n<li>Select the version you want to install and wait, but take a look while it&#8217;s installing. Ignore the errors, it&#8217;ll work anyway<\/li>\n<\/ol>\n<p>Once the installer finished with errors, open QtCreator and load your project. Now you have to manage your &#8220;Kit&#8221;. Select &#8220;Project&#8221; on the left sidebar, &#8220;Build &amp; Run&#8221; on top and then click &#8220;Manage kits&#8230;&#8221;<\/p>\n<ul>\n<li>Click &#8220;Add&#8221; and select the new version for &#8220;Debugger&#8221; and &#8220;Qt version&#8221;<\/li>\n<li>Give it a &#8220;Name:&#8221;. Best to copy the string from the Auto-detected version<\/li>\n<li>Apply<\/li>\n<li>Now change the Kit of your project to the new one. The thingy above &#8220;Build|Run&#8221; right beside &#8220;Manage Kits&#8230;&#8221; is a drop down box, even if it doesn&#8217;t look like it<\/li>\n<li>Change the build directory accordingly<\/li>\n<li>Clear the environment by selecting &#8220;Build&#8221; instead of &#8220;Run&#8221;. Then expand &#8220;Build Environment&#8221; at the bottom and check &#8220;Clear system environment&#8221;<\/li>\n<li>Select &#8220;Run&#8221; and set &#8220;Base environment for this configuration&#8221; to &#8220;Build environment&#8221;<\/li>\n<\/ul>\n<p>If you don&#8217;t need SQL-Plugins, clean all, run qmake and compile. If you need access to, say, a Postgres-DB, the fun doesn&#8217;t end yet. To connect to the database, you have to add the directory with libpq.dll to the PATH. Yes, to the PATH environment variable! WTF? For now that would be &#8220;C:\\psql\\9.5\\bin&#8221;.<\/p>\n<p>If you create a new project, don&#8217;t forget to add<\/p>\n<pre>QT       += sql\r\nLIBS     += \"C:\\psql\\9.5\\lib\\libpq.lib\"<\/pre>\n<p>to you .pro-file.<\/p>\n<p>If you build a release, don&#8217;t forget to copy the dll-files to the release directory. For a QT-Gui application those would be at least:<\/p>\n<ul>\n<li>libeay32.dll<\/li>\n<li>libecpg.dll<\/li>\n<li>libecpg_compat.dll<\/li>\n<li>libgcc_s_dw2-1.dll<\/li>\n<li>libiconv-2.dll<\/li>\n<li>libintl-8.dll<\/li>\n<li>libpgtypes.dll<\/li>\n<li>libpq.dll<\/li>\n<li>libstdc++-6.dll<\/li>\n<li>libwinpthread-1.dll<\/li>\n<li>libxml2.dll<\/li>\n<li>libxslt.dll<\/li>\n<li>Qt5Core.dll<\/li>\n<li>Qt5Gui.dll<\/li>\n<li>Qt5Sql.dll<\/li>\n<li>Qt5Widgets.dll<\/li>\n<li>ssleay32.dll<\/li>\n<li>zlib1.dll<\/li>\n<\/ul>\n<p>Well, I hope I didn&#8217;t forget anything. See you next time!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, another lesson in How To Complicate Things &#8482;. Could be as easy as pacman -Syu, run qmake and recompile all, but far from it \ud83d\ude41 Run MaintenanceTool.exe. Of course it has no entry in the start menu, why should it. But it&#8217;s easy to find: C:\\Qt\\MaintenanceTool.exe Skip the first page, you don&#8217;t need an &hellip; <a href=\"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=330\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Update QT under Windows<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[114,113,115],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-windows","tag-postgres","tag-qt","tag-qtcreator"],"_links":{"self":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330"}],"version-history":[{"count":1,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}