32位qt编译的程序
㈠ 我是64位的系统,装的32位的qt-opensource-windows-x86-msvc2015-5.8.0,
先装visual studio2015,再装qt-opensource-windows-x86-msvc2015,然后可以直接用qtcreator编辑Qt程序
出问题的exe名称为TestApp.exe,在Visual Studio下编译运行都正常,但无法直接点击exe运行。报错为(应用程序无法正常启动(0xc000007b)。请单击“确定”关闭应用程序)
本人环境:基于visual studio IDE下的QT编译器,共有四种,在 qt-版本号 文件夹下。
我的问题解决步骤如下:
1.看准自己项目的编译环境
我电脑虽然是64位的,但是编译器环境是32位的,故之后所有都需要以32位为标准
由于是Visual Studio ,所以采用下面文件夹中的msvc2017环境进行编译(没有标注64位就是32位)
2.添加系统环境变量
打开控制面板搜索环境变量,对系统path进行更改
按照上一步的环境进行配置!!!不要添加冗余路径,一项即可!!
PS:多项也可以,但是要在IDE中选择正确的default编译器,不然系统会搞混64和32位的dll
3.进入qt自带的命令行中
开始框中搜索 → 选择合适的环境(比如我是MSVC 2017 32-bit)→ 进入目标exe程序所在文件夹
输入命令
windeployqt xxx(目标exe名称)
复制
PS:该命令(windeployqt)若添加了系统Path后,也可以直接在系统cmd中运行,前提是:环境Path只有适合自己项目的那一项!!(only 32 or 64) 否则系统会弄混。。。然后就又失败链接了qaq
此时,在exe的文件夹下面会多出很多文件夹和dll文件,表明已经link成功
再次强调:不同位数的编译器链接出来的dll不同!一定一定要适合自己的程序
㈢ 64位系统上装32位的Qt,用来开发64位的程序,这样可以吗
基本类型在 64位系统和 32位系统不一样,指令集也有区别。64位编译的程序不能直接链接到32位的库。链接库的位必须兼容。64位链接32位,链接会失败。必须安装qt64bit。
㈣ 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:
㈤ 高分求教,Qt如何加载调用win32程序编译的DLL
Qt提供了一个 QLibrary 类供显示调用。下面给出一个完整的例子:
testDLL.dll为自定义的dll文件,将其复制到程序的输出目录下就可以调用。
#include <QApplication>
#include <QLibrary>
#include <QDebug>
#include <QMessageBox>
typedef int (*Fun)(int,int); //定义函数指针,以备调用
int main(int argc,char **argv)
{
QApplication app(argc,argv);
QLibrary mylib("testDLL.dll"); //声明所用到的dll文件
int result;
if (mylib.load()) //判断是否正确加载
{
QMessageBox::information(NULL,"OK","DLL load is OK!");
Fun open=(Fun)mylib.resolve("add"); //援引 add() 函数
if (open) //是否成功连接上 add() 函数
{
QMessageBox::information(NULL,"OK","Link to Function is OK!");
result=open(5,6); //这里函数指针调用dll中的 add() 函数
qDebug()<<result;
}
else
QMessageBox::information(NULL,"NO","Linke to Function is not OK!!!!");
}
else
{
QMessageBox::information(NULL,"NO","DLL is not loaded!");
return 0; //加载失败则退出
}
}
㈥ qt编译的程序无法单独运行提示连接不到libstdc++-6.dll
丢失动态链接库的文件问题很常见,其实解决方法很简单,就是补一个
周围同事和朋友的电脑里去考一个到你自己机子上补上
如果没有,就网上下载,推荐一个网站是脚本之家,这种很全,应该能找到
常用的DLL文件,其实腾讯电脑管家就能修复,电脑诊所--软件问题--丢失.Dll 文件--一键修复
不常用的,可以用这个工具dx修复工具3.0增强版