PDA

View Full Version : Create a static application for linux using QT.



predatorz
16th January 2010, 05:22
Hi,

How do i compile a static application for linux using qt?
I am using QT 4.6 SDK to write the programs
Using http://qtnode.net/wiki?title=Building_static for a guide, I have run configure -static and mingw32-make sub-src using the QT Command prompt in windows.
The process took a few hrs and i compiled the program in windows which created a 9.32mb executable and i copied 4 .dll files over to the same folder and i am able to run the executable normally.
Do i also need to do the same for linux OS (configure -static and make sub-src) to make a static application?


# -------------------------------------------------
# Project created by QtCreator 2010-01-11T17:41:55
# -------------------------------------------------
CONFIG += static
CONFIG += staticlib
static {
TARGET = test
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
OTHER_FILES += Icons/Thumbs.db \
Icons/onebit_26.png \
Icons/onebit_24.png \
Icons/onebit_18.png \
Icons/onebit_13.png \
Icons/onebit_12.png \
Icons/onebit_10.png \
Icons/onebit_09.png \
Icons/macforger.JPG \
Icons/icon-20.png \
Icons/icon-19.png \
Icons/icon-16.png \
Icons/icon-11.png \
Icons/icon-06.png \
Icons/icon-04.png \
Icons/002_26.ico \
Icons/002_04.ico \
Icons/test_4.PNG
}

axeljaeger
19th January 2010, 22:16
Yes, it works the same on linux. But what 4 dlls where still required? I guess the runtime for the compiler. You should not need to copy those over on linux.