문제

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