PDA

View Full Version : standalone Qt .Exe



bunjee
23rd July 2007, 21:22
Hi,

Here is my QT project release makefile:


################################################## ###########################
# Makefile for building: client
# Generated by qmake (2.01a) (Qt 4.3.0) on: lun. 23. juil. 21:15:59 2007
# Project: client.pro
# Template: app
################################################## ###########################

####### Compiler, tools and options

CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NEEDS_QMAIN -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT
CFLAGS = -O2 -Wall $(DEFINES)
CXXFLAGS = -O2 -frtti -fexceptions -mthreads -Wall $(DEFINES)
INCPATH = -I"..\..\..\Qt\4.3.0\include\QtCore" -I"..\..\..\Qt\4.3.0\include\QtCore" -I"..\..\..\Qt\4.3.0\include\QtNetwork" -I"..\..\..\Qt\4.3.0\include\QtNetwork" -I"..\..\..\Qt\4.3.0\include\QtGui" -I"..\..\..\Qt\4.3.0\include\QtGui" -I"..\..\..\Qt\4.3.0\include" -I"..\common" -I"..\common\libpurple\include" -I"..\common\glib\include" -I"..\common\glib\include\glib" -I"..\common\glib\include\gmodule" -I"..\common\glib\include\gobject" -I"..\..\..\Qt\4.3.0\include\ActiveQt" -I"release" -I"." -I"..\..\..\Qt\4.3.0\mkspecs\win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-subsystem,windows -mthreads -Wl
LIBS = -L"c:\dev\Qt\4.3.0\lib" -lmingw32 -lqtmain release\ZeMessenger_res.o -L../common/libpurple/lib -llibpurple -L../common/glib/lib -lglib-2.0 -lQtGui4 -lQtNetwork4 -lQtCore4
QMAKE = c:\Dev\Qt\4.3.0\bin\qmake.exe
IDC = c:\dev\Qt\4.3.0\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE = release\ZeMessenger_res.o
COPY = copy /y
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)

I'm compiling using mingw Gcc on windows.

For some reason it won't work when launched on a machine where QT isn't installed.
Is there any special flag to specify to get a fully standalone .exe ?

Thanks.

Mr Arnaud.

fullmetalcoder
23rd July 2007, 21:26
You need to recompile Qt as static libraries and then to link your program against those static libs rather than against dlls that come by default... This is a tedious way to go but the only one if you neither want to distribute dlls along your exe nor to force end users to have Qt installed...

Teuniz
23rd July 2007, 21:36
Have a look here:

http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Windows

ufo-vl
25th July 2007, 02:07
Hello,

It's actual for other platforms?
For example MAC OS X and Linux.

Teuniz
25th July 2007, 09:40
Hello,

It's actual for other platforms?
For example MAC OS X and Linux.
I never tried the Mac, but the wiki for building static on Linux is ok,
I use that procedure every time when I install a newer version of Qt.

http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux

ufo-vl
25th July 2007, 16:09
thanks for your message :-)