views:

1463

answers:

5
+4  Q: 

Qt executable

Is there a quick, straightforward way to make a Qt application into an executable? I attempted to follow the instructions at http://doc.trolltech.com/4.1/deployment-windows.html but have been unsuccesfull thus far; I'm unable to Any help would be much appreciated. Thanks!

+1  A: 

Do you mean an installer package? I assume you are able to compile, link, and run your app and you mean how do you package it up for others.

http://installbuilder.bitrock.com/ <-- special handling of Qt based projects but costs $ http://www.jrsoftware.org/isinfo.php <-- my personal favorite and it's free (can be rough to learn advanced features though)

Though if you mean how do you build your app, you may want to try the new Qt Creator (http://www.qtsoftware.com/products/appdev/developer-tools/developer-tools#qt-tools-at-a) which will setup build targets for you and really makes desktop Qt dev a snap. Also if you're still using 4.1, you can now use 4.5 under the LGPL on all platforms making it almost a no-brainer to upgrade.

Trey Stout
Thanks a lot - sorry to be so naive, but how do I use apps like the bitrock/jrsoftware... Like if i wanted to port a basic program (hello world for example) through the Inno Setup app, do i just copy and paste the code / dependencies? I apologize for my ignorance.
+2  A: 

I always use CMake to build Qt projects, it's easy, free and cross platform. Guide : Compiling Qt4 apps with CMake. CMake also come with CPack to easly make installer for Windows, Mac and Linux.

I agree with chmod700 about the Qt Creator suggestion, it's not my favorite IDE but it's still really nice and easy.

brunoqc
+1  A: 

I'm not sure if I understand your problem. Assuming you're using MinGW, it's really easy and quite straightforward:

  • get the Qt sources and unpack them to some folder (f.e. c:\Qt\4.5.0-static)
  • install MinGW. Make sure the MinGW executable folder is in the %PATH% variable.
  • open a cmd windows, go to the Qt sources and run configure -static. You can add other config options if you like to, but usually you don't need that.
  • when building Qt finished, go to your application sources, open a cmd window and run the qmake of your built Qt installation -- i.e. c:\Qt\4.5.0-static\bin\qmake in the example given above.
  • run make
  • you get a statically linked binary in the end (you might want to check it with Dependency Walker).

Doing the same using Visual Studio is pretty similar.

Or do you want to build dynamically and create an installer package?

bluebrother
A: 

@bluebrother

Thanks a lot, I was able to build the statically linked binary, now i just need to package it with the executable so it can be deployed... is it easy enough to do that as well?

A: 

"run make"

Oh man! I don't have any "make" program! You are talking about "mingw32-make.exe" ?? Or about VC++ "nmake"?