[Interest] I can´t compile Qt statically (statically link)

Ernesto ernestoac at icrt.cu
Mon Jan 16 04:05:28 CET 2017

Hello everyone,

Now I´m blocked trying to (statically link) compile Qt statically (I´m 
using Qt 5.5.0) to runs my applications without Qt and others libraries. 
I did the following:

First I went to /C:\Qt\Qt5.5.0\5.5\mingw492_32\mkspecs\win32-g++\/ and 
edited /qmake.conf/

I put in QMAKE_LFLAGS something like this:

/QMAKE_LFLAGS= -static -enable-stdcall-fixup -wl,-enable-auto-import 

Next I opened the Qt console

So /configure/ command doesn´t work, I have to change the default path 
for Qt console (/C:\Qt\Qt5.5.0\5.5\mingw492_32/) to 
/C:\Qt\Qt5.5.0\5.5\Src\qtbase /because /configure.exe/ doesn´t exist in 
/mingw492_32/ folder, it is in /qtbase/ folder.

So I enter

/configure -platform win32-g++ -static –release/

And the last lines of output was:

/Creating qmake.../

/mingw32-make: Nothing to be done for 'first'./

/Running configuration tests.../

/WARNING: The DirectX SDK could not be detected:/

/There is no Direct X SDK installed or the environment variable 
"DXSDK_DIR" is not set./

/Disabling the ANGLE backend./

/WARNING: Using OpenGL ES 2.0 without ANGLE./

/Specify -opengl desktop to use Open GL./

/The build will most likely fail./

/(Press any key to continue...)/

When I press any key, runs and I get this:

/Qt is now configured for building. Just run mingw32-make./

/To reconfigure, run mingw32-make confclean and configure./


And later I type /mingw32-make sub-src /and I wait with patience. 
Several minutes later I get that:

/Makefile:34: recipe for target 'release' failed/

/mingw32-make[2]: *** [release] Error 2/

/mingw32-make[2]: Leaving directory 

/Makefile:188: recipe for target 'sub-qlalr-make_first' failed/

/mingw32-make[1]: *** [sub-qlalr-make_first] Error 2/

/mingw32-make[1]: Leaving directory 'c:/Qt/Qt5.5.0/5.5/Src/qtbase/src'/

/makefile:38: recipe for target 'sub-src' failed/

/mingw32-make: *** [sub-src] Error 2/


Return to my Project file (.pro) and add the following line of code:

/CONFIG += static/

When I compile the Project its show me this errors:

/:-1: error: error: unrecognized command line option 

/:-1: error: error: unrecognized command line option 

I went to qmake.conf file of the beginning and delete this two 
arguments, it will result like this:

/QMAKE_LFLAGS= -static -enable-stdcall-fixup/

I compile and:

/:-1: warning: cannot find entry symbol nable-stdcall-fixup; defaulting 
to 00401000/

So again I delete this args, resulting:

/QMAKE_LFLAGS= -static/

When I compile at this point, Qt says me (xxx is the rest of project 
absolute path):

/Starting xxx\release\DynamicLink.exe.../

/xxx\release\DynamicLink.exe exited with code 1989883493/


And doesn´t shows my MainWindows.

Regards for all,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170116/7d82a2e7/attachment.html>

More information about the Interest mailing list