下面我来试一试.
用的是git 安装的时候附带的 bash:
./configure -opensource -confirm-license -static -platform win32-g++ -prefix d:/Qt/Qt5.9.7/5.9.7/mingw530_32_static/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-compile-examples -nomake tools -nomake demos -nomake tests -nomake examples
离线
debugdump@DESKTOP-32PC8B1 MINGW64 /d/Qt/Qt5.9.7/5.9.7/Src
$ ./configure -opensource -confirm-license -static -platform win32-g++ -prefix d:/Qt/Qt5.9.7/5.9.7/mingw530_32_static/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-compile-examples -nomake tools -nomake demos -nomake tests -nomake examples
+ cd qtbase
+ /d/Qt/Qt5.9.7/5.9.7/Src/qtbase/configure -top-level -opensource -confirm-license -static -platform win32-g++ -prefix d:/Qt/Qt5.9.7/5.9.7/mingw530_32_static/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-compile-examples -nomake tools -nomake demos -nomake tests -nomake examples
Creating qmake...
................................................ ....................................Done.
Info: creating super cache file D:\Qt\Qt5.9.7\5.9.7\Src\.qmake.super
ERROR: Invalid value 'demos' supplied to command line option 'nomake'.
提示了一个错误, 所以只能改一下命令行:
./configure -opensource -confirm-license -static -platform win32-g++ -prefix d:/Qt/Qt5.9.7/5.9.7/mingw530_32_static/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-compile-examples -nomake tools -nomake tests -nomake examples
离线
嗯, 这次 OK:
debugdump@DESKTOP-32PC8B1 MINGW64 /d/Qt/Qt5.9.7/5.9.7/Src
-examples -nomake tools -nomake tests -nomake examplestype -opengl desktop -no-compile-
+ cd qtbase
+ /d/Qt/Qt5.9.7/5.9.7/Src/qtbase/configure -top-level -opensource -confirm-license -static -platform win32-g++ -prefix d:/Qt/Qt5.9.7/5.9.7/mingw530_32_static/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-compile-examples -nomake tools -nomake tests -nomake examples
Creating qmake...
.Done.
Info: creating stash file D:\Qt\Qt5.9.7\5.9.7\Src\.qmake.stash
This is the Qt Open Source Edition.
You have already accepted the terms of the Open Source license.
Running configuration tests...
Checking for valid makespec... yes
Checking for alloca() in alloca.h... no
Checking for alloca() in malloc.h... yes
Checking for target architecture... i386
Checking for SSE2 instructions... yes
Checking for SSE3 instructions... yes
Checking for SSSE3 instructions... yes
Checking for SSE4.1 instructions... yes
Checking for SSE4.2 instructions... yes
Checking for AVX instructions... yes
Checking for AVX2 instructions... yes
Checking for AVX512 F instructions... yes
Checking for AVX512 BW instructions... yes
Checking for AVX512 CD instructions... yes
Checking for AVX512 DQ instructions... yes
Checking for AVX512 ER instructions... yes
Checking for AVX512 IFMA instructions... yes
Checking for AVX512 PF instructions... yes
Checking for AVX512 VBMI instructions... yes
Checking for AVX512 VL instructions... yes
Checking for C++14 support... yes
Checking for C++1z support... yes
Checking for D-Bus >= 1.2... no
Checking for F16C instructions... yes
Checking for D-Bus >= 1.2 (host)... yes
Checking for IncrediBuild... no
Checking for udev... no
Checking for -Og support... yes
Checking for POSIX fallocate()... no
Checking for precompiled header support... yes
Checking for STL compatibility... yes
Checking for eventfd... no
Checking for inotify... no
Checking for slog2... no
Checking for 64 bit atomics... yes
Checking for DoubleConversion... no
Checking for O_CLOEXEC... no
Checking for working std::atomic for function pointers... yes
Checking for getaddrinfo()... yes
Checking for getifaddrs()... no
Checking for IPv6 ifname... no
Checking for OpenSSL Headers... no
Checking for XCB >= 1.5 (core)... no
Checking for Direct 2D... no
Checking for DirectWrite... yes
Checking for DirectWrite 2... no
Checking for Desktop OpenGL... yes
Checking for EGL... no
Checking for evdev... no
Checking for GBM... no
Checking for KMS... no
Checking for LinuxFB... no
Checking for mtdev... no
Checking for OpenVG... no
Checking for default QPA platform... windows
Checking for tslib... no
Checking for xkbcommon... no
Checking for XLib... no
Checking for uxtheme.h... yes
Checking for CUPS... no
Checking for DB2 (IBM)... no
Checking for InterBase... no
Checking for MySQL... no
Checking for OCI (Oracle)... no
Checking for ODBC... yes
Checking for PostgreSQL... no
Checking for SQLite (version 2)... no
Checking for TDS (Sybase)... no
Checking for Direct3D 12... no
Checking for SDL2... no
Checking for Assimp... no
Checking for Autodesk FBX... no
Checking for Wayland EGL library... no
Checking for BlueZ... no
Checking for sensorfw... no
Checking for Gypsy... no
Checking for WinRT Geolocation API... no
Checking for DirectShow... yes
Checking for evr.h... yes
Checking for GStreamer 1.0... no
Checking for GStreamer 0.10... no
Checking for OpenAL... no
Checking for libresourceqt5... no
Checking for Windows Audio Services... no
Checking for WMF... no
Checking for wmsdk.h... no
Checking for WShellItem... yes
Checking for embedded... no
Checking for Python 2...
Checking for system ninja... no
Done running configuration tests.
Configure summary:
Build type: win32-g++ (i386, CPU features: <none>)
Configuration: sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl f16c largefile optimize_debug precompile_header debug_and_release release debug build_all c++11 c++14 c++1z concurrent dbus no-pkg-config release_tools static stl
Build options:
Mode ................................... debug and release; default link: debug; optimized tools
Optimize debug build ................... yes
Optimize release build for size ........ no
Building shared libraries .............. no
Using C++ standard ..................... C++1z
Using gold linker ...................... no
Using precompiled headers .............. yes
Using LTCG ............................. no
Target compiler supports:
SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
AVX .................................. AVX AVX2 F16C
AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
Build parts ............................ libs
App store compliance ................... no
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... no
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... no
QML debugging .......................... yes
udev ................................... no
Using system zlib ...................... no
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ no
GLib ................................... no
iconv .................................. no
ICU .................................... no
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getaddrinfo() .......................... yes
getifaddrs() ........................... no
IPv6 ifname ............................ no
libproxy ............................... no
OpenSSL ................................ no
Qt directly linked to OpenSSL ........ no
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ no
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. no
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... no
PNG .................................. yes
Using system libpng ................ no
EGL .................................... no
OpenVG ................................. no
OpenGL:
ANGLE ................................ no
Desktop OpenGL ....................... yes
Dynamic OpenGL ....................... no
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. no
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon-evdev ........................ no
QPA backends:
DirectFB ............................... no
EGLFS .................................. no
LinuxFB ................................ no
VNC .................................... no
Mir client ............................. no
Windows:
Direct 2D ............................ no
DirectWrite .......................... yes
DirectWrite 2 ........................ no
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows WindowsXP WindowsVista
Qt PrintSupport:
CUPS ................................... no
Qt Sql:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... yes
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt SerialBus:
Socket CAN ............................. no
Socket CAN FD .......................... no
QtXmlPatterns:
XML schema support ..................... yes
Qt QML:
QML interpreter ........................ yes
QML network support .................... yes
Qt Quick:
Direct3D 12 ............................ no
AnimatedImage item ..................... yes
Canvas item ............................ yes
Support for Qt Quick Designer .......... yes
Flipable item .......................... yes
GridView item .......................... yes
ListView item .......................... yes
Path support ........................... yes
PathView item .......................... yes
Positioner items ....................... yes
ShaderEffect item ...................... yes
Sprite item ............................ yes
Qt Gamepad:
SDL2 ................................... no
Qt 3D:
Assimp ................................. yes
System Assimp .......................... no
Output Qt3D Job traces ................. no
Output Qt3D GL traces .................. no
Qt 3D GeometryLoaders:
Autodesk FBX ........................... no
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Qt Bluetooth:
BlueZ .................................. no
BlueZ Low Energy ....................... no
Linux Crypto API ....................... no
Qt Sensors:
sensorfw ............................... no
Qt Quick Controls 2:
Styles ................................. Default Material Universal
Qt Quick Templates 2:
Hover support .......................... yes
Multi-touch support .................... yes
Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Geoservice plugins:
OpenStreetMap ........................ yes
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. yes
Itemsoverlay ......................... yes
Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ no
OpenAL ................................. no
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. yes
Windows Media Foundation ............... no
Media player backend ................... DirectShow
Qt WebEngine:
Embedded build ......................... no
Pepper Plugins ......................... yes
Printing and PDF ....................... yes
Proprietary Codecs ..................... no
Spellchecker ........................... yes
WebRTC ................................. yes
Using system ninja ..................... no
Note: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.
Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine.
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into 'd:\Qt\Qt5.9.7\5.9.7\mingw530_32_static'.
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
离线
离线
参考这个帖子: https://forum.qt.io/topic/62614/remove-dependency-to-libwinpthread-1-dll/12
完美解决上面的问题
pro 文件添加:
CONFIG+=static
QMAKE_LFLAGS+="-static -static-libgcc -static-libstdc++ -lstdc++"
DEFINES+=STATIC
离线
好帖,留名学习
离线
后来发现一个恼人的问题, 虽然可以不用带任何第三方dll文件, 但是不能在 windows xp 32bit 电脑运行。
后来发现一个恼人的问题, 虽然可以不用带任何第三方dll文件, 但是不能在 windows xp 32bit 电脑运行。
后来发现一个恼人的问题, 虽然可以不用带任何第三方dll文件, 但是不能在 windows xp 32bit 电脑运行。
后来发现一个恼人的问题, 虽然可以不用带任何第三方dll文件, 但是不能在 windows xp 32bit 电脑运行。
后来发现一个恼人的问题, 虽然可以不用带任何第三方dll文件, 但是不能在 windows xp 32bit 电脑运行。
离线
接下来还得试一试 Qt5.6 才行: https://blog.csdn.net/libaineu2004/article/details/80415755
仍然使用 mingw:
Qt5可以使用msvc编译器和mingw编译器,而msvc的编译器从2015开始就对xp的支持变差,就算通过各种编译配置命令设置,能xp下运行,但是会很可能发生一些奇奇怪怪的bug。而mingw编译器没有这个问题,同一个版本可以在xp win7 win10各个系统使用,而无需其他配置。另外,Qt5目前有两个长期支持版本(Long Term Support)Qt5.6和Qt5.9,Qt5.6可以在XP和win7及以上系统开发,而Qt5.9只支持win7以上的系统开发和部署。 所以如果想使用Qt5的新功能,又想开发出的软件能在xp系统上运行,可以选择Qt5.6的mingw-32bit版本或者vs2013版本进行开发。
1、Qt从5.7版本开始不再支持WinXP系统,即编译生成的exe文件无法在WinXP系统运行。
2、Qt5.6是长期支持版本Long Term Support,它可以支持WinXP-32bit的系统。参考:http://doc.qt.io/qt-5.6/supported-platforms.html
下载网站是:
http://download.qt.io/official_releases/qt/5.6/
请注意,这几个版本是完全ok的:
qt-opensource-windows-x86-msvc2013_64-5.6.3.exe
qt-opensource-windows-x86-msvc2013-5.6.3.exe
qt-opensource-windows-x86-mingw492-5.6.3.exe
vs2015编译出来的版本在WinXP是不ok的,在WinXP环境下,会出现字体乱码(含删除线,本人亲测)的问题。
qt-opensource-windows-x86-msvc2015_64-5.6.3.exe
qt-opensource-windows-x86-msvc2015-5.6.3.exe
离线
Qt 5.6.3 正在安装。
configure -opensource -confirm-license -static -platform win32-g++ -prefix d:/Qt/Qt5.6.3/5.6.3/mingw492_32_static/ -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-compile-examples -nomake tools -nomake tests -nomake examples
配置完成
编译完成
离线
离线
参考这个帖子: https://forum.qt.io/topic/62614/remove-dependency-to-libwinpthread-1-dll/12
完美解决上面的问题
pro 文件添加:
CONFIG+=static
QMAKE_LFLAGS+="-static -static-libgcc -static-libstdc++ -lstdc++"
DEFINES+=STATIC
感谢!终于搞定了,可以不用带其他 dll 直接跑了
离线
试了一下静态链接, 非常OK
离线
wow
厉害了, 非常感谢!
我说呢, 公司的软件总是带一堆7788动态链接库.
离线
收藏备用!
离线
学习了!
离线
收藏
离线
参考这个帖子: https://forum.qt.io/topic/62614/remove-dependency-to-libwinpthread-1-dll/12
完美解决上面的问题
pro 文件添加:
参考这个帖子搞定! 现在不依赖其他第三方dll了,谢谢!
离线