qt編譯成32位的庫
Ⅰ Qt+Mysql開發筆記:Qt5.9.3的mingw32版本編譯MySql8版本驅動並Demo連接資料庫測試
前言
為了實現更好的跨平台兼容,本文將詳細介紹如何在Qt5.9.3 mingw32版本下編譯MySQL8版本的驅動庫,並通過示例連接資料庫進行測試。具體操作將涉及環境配置、驅動編譯、庫替換、應用構建和資料庫配置等步驟。
編譯環境
本示例使用Qt5.9.3與mingw32環境,確保在開發環境中選擇源碼安裝選項。同時,下載並安裝MySQL-installer-community-8.0.16.0。
下載資料庫
從 downloads.mysql.com/arc... 獲取32位驅動運行程序並解壓。
編譯MySQL驅動庫
步驟一:安裝Qt5.9.3並勾選mingw32版本。
步驟二:下載並解壓32位資料庫運行包。
步驟三:在Qt Creator中打開MySQL源碼工程。
步驟四:執行qmake並進行構建。
構建成功後,庫將生成在根目錄下。
步驟五:替換插件中的MySQL庫。
步驟六:將libmysql.dll拷貝至bin目錄,確保在運行環境可用。
步驟七:編譯應用並連接測試。
應用成功編譯並提示驅動連接無誤。
步驟八:配置資料庫賬號允許遠程操作。
修改資料庫用戶的配置,允許遠程登錄。
步驟九:測試遠程操作工具連接。
由於MySQL8加密規則變更,客戶端連接軟體不支持新的加密方式。調整資料庫用戶加密方式至舊驗證模式。
總結
通過本文,您已學會如何在Qt5.9.3 mingw32版本下編譯並配置MySQL8版本驅動庫,實現了與資料庫的成功連接。在進行應用打包時,確保libmysql.dll被正確復制,以確保跨平台運行無誤。
Ⅱ qt-opensource-linux-x64-5.6.3.run有沒有對應的32位版本,官網上沒找到,有什麼辦法可以解決
建議用 5.5.1 ,功能差不了太多,要不就得自己在32位系統下從源碼編譯Qt了。
http://download.qt.io/archive/qt/5.5/5.5.1/
先確認必須在32位系統下使用的必要性。再看看5.6的新功能是否有必須用到的。
New Features in Qt 5.6
New Features
Qt Core
Reced memory usage of dynamic properties
Allow logging directly to syslog on Linux systems
Added QStorageInfo::blockSize()
new QVersionNumber class
Added key_iterator to QHash and QMap
Added const_iterator QByteArray
Added reverse iterator support to all sequential containers
added QDir::listSeparator()
Lots of performance optimisations in QString
Qt Network
Added QHostAddress::isMulticast()
Support HTTP redirection in QNetworkAccessManager
Qt GUI
Improved cross-platform OpenGL ES 3.0 and 3.1 support to help the development of mobile/embedded apps utilizing GLES3 features.
Improved cross-platform high-dpi support.
Raster engine support for rendering internally with 16bits-per-color.
QImageReader now exports gamma values and other meta data for some image formats
Qt Widgets
Allow programmatic resizing of dock widgets
Allow dropping dock widgets into floating docks
Allow the user to re-arrange tabified docks
Allow horizontal scrolling using a mouse wheel in QListView
QOpenGLWidget and QQuickWidget are now supported on WinRT
Qt Testlib
More stable input event handling
Qt Multimedia
New Playlist QML type.
New audio role API for the media player (C++ and QML)
Support for camera focus and video probe on WinRT
New functions in QML AudioEngine to support dynamic object creation
Qt WebEngine
Based on Chromium 45
Support for pepper plugins including Flash
Support for unbundling and linking with system libraries on Linux
Support for following global Qt proxy settings.
More WebActions from QtWebKit and WebAction API in QML.
New QtWebEngineCore mole for shared low-level API
New core API for custom URL schemes
New core API for intercepting and blocking network requests
New core API for tracking or blocking cookies.
Qt QML
Support for writing JavaScript function names to Linux's perf output
Reced overall memory consumption
Moved all the debug services into plugins. Custom debug services can be added width additional plugins.
Font rendering
Optional support for using FreeType on Mac OS X
Embedded platforms
Added support for NVIDIA Jetson TK1 Pro boards running Vibrante Linux via a new eglfs backend utilizing DRM, EGLDevice and EGLStream
Added support for Intel Atom-based NUCs
Desktop platforms
Windows 10 fully supported (classic and WinRT app)
Windows Store apps are now composited inside a XAML layer, allowing for better integration with the native UI layer
Windows embedded
Added support for WEC2013
Qt WebView
Added support for WinRT
Qt Canvas3D
Support for using Qt Quick items as textures
Support for rendering directly to Qt Quick scene background or foreground
Qt Nfc
Added support for Android
Qt Positioning
Added support for OS X
Added support for GPS receivers exposed as a serial port on Windows desktop (all versions)
Removed libgeoclue dependency for the GeoClue backend
Qt Location
Added the Qt Location mole providing maps, navigation and places APIs for Qt Quick
Embedded platforms
libinput, when present, is now the default for eglfs and linuxfb
Image Formats
For security reasons, the MNG and JPEG 2000 handlers will by default no longer be built, unless the corresponding codec libraries are provided by the OS. Hence, the binary Qt releases for Windows and Mac will not contain prebuilt handlers for those formats, but users can still build them from source.
Qt Script
Qt Enginio
Qt WebKit
Qt Declarative (Qt Quick 1)
Other Changes
Deprecated Moles
The following moles are part of Qt 5.6 release, but deprecated and considered for removal in subsequent releases of Qt:
Removed Moles
With Qt 5.6 the following moles are no longer part of the release packages, but users can still build them from source:
Ⅲ 64位系統上裝32位的Qt,用來開發64位的程序,這樣可以嗎
基本類型在 64位系統和 32位系統不一樣,指令集也有區別。64位編譯的程序不能直接鏈接到32位的庫。鏈接庫的位必須兼容。64位鏈接32位,鏈接會失敗。必須安裝qt64bit。
Ⅳ qt 5 在64位系統下怎麼會是32位的環境
看你安裝的是什麼版本的吧,在64位也能安裝32程序當然也能配置32位的環境啦。
之前有個工程要調用32的庫,在vs中使用msvc2015編譯器編譯qt工程,下載的qt是64位的只好重新下載一個32位的qt。
Ⅳ qt 64 位編程和32位編程的區別
一、64位編譯器系統下可以使用64位的無符號或有符號變數了。
二、64位操作系統提供了更多的編程介面API,這些多出來的介面主要是涉及將32位數據類型擴展為64位的問題了。比如原來關於內存管理相關的函數,參數是32位的,在64位操作系統下就需要提供參數為64位的管理函數了等等。
Ⅵ ubuntu64位怎麼編譯32位qt庫
64位可以編32位的程序出來,在各種FLAGS中增加 -m32 編出來的就是32位程序,連接時自然是找32位的共享庫
這個要看發行版對32位支持的實現,比如gentoo下如果開abi支持雙架構那很可能悲劇,因為有些包還沒跟上,如果用binary的32位庫又會因為版本不同出現莫名其妙的問題,比如fontconfig的坑。
我在64位編32位程序都是使用chroot的方法,這樣就可以把32位的頭文件庫什麼的全放在某個地方。我用的是ubuntu,32位庫和64位庫位置不一樣,一般可以直接安裝32位的庫,如果遇到某些比較特殊的庫,一般都可以通過重新編譯增加rpath解決,如果沒源碼也可以用patchelf直接給elf上rpath。
如果您認可我的答案,請採納。
您的採納,是我答題的動力,O(∩_∩)O謝謝!!