完全了解逻辑层次os/compiler/framework/application中静态链接、动态链接情况的,请绕道。
linux以及Xnux的大牛,也不用看了。
要想Qt应用做出来只是一个exe就能给客户运行,
有两个情况,搞定即可:
一、mingwm10.dll,libgcc_s_dw2-1.dll依赖
这与qt无关
用vc编译的就不存在……依赖这俩玩意的情况。
那么mingw版下的QT呢?
下载,静态版mingw(mingw本身和gcc都是static version)即可,见文末资源。
二、QtCoreX.dll QtXXX.dll等依赖
指定你的应用本身为静态编译即可。
1、project.pro添加QMAKE_LFLAGS=-static,
2、qt本身是静态版编译的,步骤见文末资源。
以上俩条件都需要,虽然qt静态版的,不用满足1即可,但是
逻辑上工程层次得指定,否则假设你是开源的,
别的兄弟拿过去编译,可能有些入行不久的会问为什么他的编译出来的不是一个文件了,呵呵。
而且你保不定自己就一直只有一套qt在跑,我就是静态动态版的都在用。
资源
--------------------------------------------------------------------------------
1、mingw静态编译版本:
有牛人http://code.google.com/p/qp-gcc/ 已经做好了,