Qt5.1.0 Static linking, “This application cannot b

2019-08-04 01:24发布

These are the exact steps that I took:

  1. Installed Qt 5.1.0 from this link and placed it in C:\Qt\Qt5.1.0\: http://download.qt-project.org/development_releases/qt/5.1/5.1.0-rc2/qt-windows-opensource-5.1.0-rc2-mingw48_opengl-x86-offline.exe

  2. Extracted sources and put it into C:\Qt\Qt5.1.0\Source\: http://download.qt-project.org/development_releases/qt/5.1/5.1.0-rc2/single/qt-everywhere-opensource-src-5.1.0-rc2.zip

  3. Installed Active Python 2.7 in: C:\Python27\ (Added to PATH), Ruby 200 in: C:\Qt\Qt5.1.0\Source\Ruby200\ (ticked the option to add to PATH when installing), and Perl64 in: C:\Qt\Qt5.1.0\Source\

  4. Installed only "Client C API Library" portion from mysql-5.5.32-win32.msi: http://dev.mysql.com/downloads/installer/

  5. Ran Qt5.1.0 for Desktop (MinGW 4.8 32 bit) as admin and typed configure -static -qt-sql-mysql -I C:\MySql\include -L C:\MySql\lib all in one line. Like so: command line that I ran

I noticed this -LC:\MySql\lib L and C stuck together when it prompted me to run mingw32-make (just above "WARNING:" It says my additional libraries are located in -LC:\MySql\lib without a space between L and C.

  1. I disregarded that and ran mingw32-make after the configure was done.

After awhile, I get this error (at the bottom of image).

This application cannot be statically linked to the fftreal library

What am I missing/not doing? I need some guidance. If there is some sort of 5.1.0 Static build guide that I can reference, that would be great! Thank you all ahead of time.

If someone is willing to guide me through this whole process to successfully create Qt statically, I am more than willing to give all the points that this site allows me to said person. (If I'm breaking some sort of rule please disregard this last statement then)

Edit: My PATH has this %APPDATA%\Python\Scripts;C:\Qt\Qt5.1.0\Source\Ruby200\bin;C:\cygwin;C:\Program Files (x86)\MiKTeX\miktex\bin\;C:\Python27\

2条回答
做自己的国王
2楼-- · 2019-08-04 01:47

Qt 5.0.* have had some bugs in static compile of Qt that does not take compilation process successfully, if they are get solved, so you can build them statically, I don't know your linker error associated with mentioned bugs or not.

Reported bugs:

Compiling static QT libraries with /MT using MSVC2010

查看更多
来,给爷笑一个
3楼-- · 2019-08-04 01:57

It failed trying to build one of the examples. Try adding -nomake expamples to your configure line.

Also. I don't think the open source license allows you to build static linked libraries.

查看更多
登录 后发表回答