PDA

View Full Version : How can i compile my app with all libraries to run in win7



Lodhart
18th January 2012, 06:13
Hi, i develop some application in past but i allways have a problem with Qt libraries. When I want just run my app, i must copy some qt library to Windows\system32. Can I compile the app with all needed ? And the size, how much more will be larger?

ChrisW67
18th January 2012, 06:25
Build a static Qt and static versions of any other libs you use, and build your application with that: see Deploying Qt Applications. The executable may be the as large as the original executable and all the associated dynamic libraries and plugins... it depends on what you use. If you are using the LGPL Qt, or any LGPL component of the commercial Qt, then your static executable will have requirements regarding relinking imposed by the licence. Other libs may impose other restrictions.

IMHO it is far easier to write an installer that puts the needed Qt libs in the same directory as the executable (not system32).

Lodhart
18th January 2012, 06:30
Build a static Qt, and build your application with that.
Maybe it's clear information. But I really don't know what you mean. Can you give me some more information?

ChrisW67
18th January 2012, 06:32
See Deploying Qt Applications.

Lodhart
18th January 2012, 06:39
Thank you a lot for quick reply.

Lodhart
19th January 2012, 06:14
Ok, I try build the newest version of Qt but with no success. Allways i have got some errors. Finally I found this tutorial: http://blog.bakojohn.com/?p=205&lang=en
And it works only with the same version(4.6.2). I don't know why but it never mind.
There is another BUT: When i build my app in release mode. It works fine. But when a try debug mode. I have got error: "Cannot open -lqtguid". From what I found on Google I understand that is the same library as Qtgui but Qtgui is for release mode and Qtguid is for debug mode.
My guess is: it's because in configure line missing "-debug" switch: "configure -static -release -no-exceptions -qt-sql-sqlite". Is that true?

And in real life. I just develop my app in debug mode with shared libraries and when I want to build my app as standalone, I use release-static mode to build.

Am I understand it well?