I downloaded qt recently.

I want to create an standalone exe, but I don't know what can I do.

In Qt5.2, the folder "(Qt)\lib" is exists, but i can't use it in Qt Creator.

So, should I build from source, or configure Qt Creator and use the "lib***.a"?

Any ideas?

Environment: MinGW-32 4.8.1(TDM) / Windows 7

有帮助吗?

解决方案

You seem to have tried CONFIG+=static, but that is not meant for this use case. That is used when you would like to use build your library to be static after the end of the build.

This is not the case here because you already have static Qt libraries available, so what you wish instead, to link those statically against your executable.

You would need to use this in your qmake project file:

LIBS += -L/path/to/the/static/QtCore -lQtCore

You could also use, albeit this would make the build-system less portable across different platforms:

LIBS += /path/to/the/statis/QtCore/libQtCore.a
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top