Re: [問題] Qt 5.2 static link版本的問題

看板C_and_CPP作者 (xXx)時間11年前 (2014/01/12 15:34), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串2/2 (看更多)
抱歉原文先刪掉 我在windows做static compile的時候是這樣做的 有成功 以下是我的方法 加 -static 到 QMAKE_LFLAGS後面 (該檔案在 D:\Qt\4.8.1\mkspecs\win32-g++\qmake.conf.) 1) 要重新recompile Qt libraries用"configure -platform win32-g++ -static -release -no-exceptions -qt-libjpeg -qt-libtiff -qt-libpng" 2) 在 main.cpp加: #include <QtPlugin> Q_IMPORT_PLUGIN(qico) 3) 在.pro加: QTPLUGIN += qico LIBS += C:/Qt/4.8.1/plugins/imageformats/libqico.a 4) 用 qmake 和 make. 不要用 qmake -project. 希望有幫助到你 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.64.119

01/13 02:24, , 1F
感謝大大回應 如果我想用qtcreator或vs呢?
01/13 02:24, 1F

01/13 22:39, , 2F
我是先用qt creater做完後想要產出static版本的時候再用
01/13 22:39, 2F

01/13 22:39, , 3F
cmd去下command
01/13 22:39, 3F
文章代碼(AID): #1IqhOFEe (C_and_CPP)
文章代碼(AID): #1IqhOFEe (C_and_CPP)