Pregunta

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

¿Fue útil?

Solución

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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top