Geza Kovacs edited this page May 16, 2017 · 7 revisions

Building a Dynamically Linked Version

Dynamically linked builds are most useful for packaging into Linux distributions. If you are attempting to build a standalone version for deployment on Windows, go to the statically linked section. If you are attempting to build a standalone version for deployment on Mac OS X, go to the Mac OS X section.


Latest tarball at


1. Extract the tarball and cd to it

2. Run the following commands:


(Note that if you are instead building from git or bzr or the source .zip file, you will need to instead use the following):

sed -i '/^RESOURCES/d'
qmake-qt4 "DEFINES += NOSTATIC" "RESOURCES -= unetbootin.qrc"

3. A dynamically linked executable which you can package will then be generated at "unetbootin"

4. If building a package, place the unetbootin_*.qm files (which were generated from the .ts files when lrelease-qt4 was run) in the /usr/share/unetbootin/ directory to enable the usage of localization.

5. If building a package, add "syslinux", "p7zip-full", "libqt4-core" (, "libqt4-gui" (, and "libqt4-network" ( as dependencies.

Building a Statically Linked Version

Statically linked builds are most useful for standalone deployment, not packaging. They are the type that is available for download on the website.

Build System

I build on Fedora 10 and Ubuntu 8.04 with g++ and mingw32, though it should work on other distributions as well.


Latest source zip package at

Instructions (Simple)

These instructions use pre-compiled versions of static Qt4 for Windows and Linux. If you'd like to build statically linked versions of Qt4 yourself, use the manual instructions instead.

1. Go to and download these files:

For Mac OS X: qt4.8.7-mac-x86.tar.xz or qt4.6.4-mac-snowleopard.tar.xz

For Windows: qt4-win.7z

For Linux: qt4-x11-glibc23.7z

2. Extract those files using 7-zip or p7zip-full on Linux, to get the directories "qt4-win" and "qt4-x11"

3. Move the qt4-win and qt4-x11 directories into the UNetbootin build directory (the same directory containing the files unetbootin.cpp and, which is src/unetbootin in the git repository.

4. cd to the UNetbootin build directory, and run the script "./build"

5. Statically linked UNetbootin binaries should be generated in the release subdirectory.

Instructions (Manual)

  1. Build a statically linked Qt4 for Windows (instructions from and )

    cd C:\Qt4 configure -static make sub-src

  2. Set up cross-compile environment (instructions from )

If cross-compiling on Ubuntu, simply copy the file qmake.conf to /usr/share/qt4/mkspecs/win32-g++/qmake.conf

  1. Copy over your statically linked Windows qt4 install directory to /usr/i586-mingw32msvc/Qt/

  2. Go to the directory containing the source files (unetbootin.cpp, main.cpp,, etc.), and run "./build" to automate steps 4 and 5, or to do it manually, run the following commands:

    qmake -spec win32-g++ "DEFINES += STATICWINDOWS" "RESOURCES += unetbootin-windows.qrc unetbootin-sevnz.qrc" "RC_FILE += ubnembed.rc" "QMAKE_LFLAGS += -Wl,-subsystem,windows"


  1. You should now have a Windows .exe file at release/unetbootin.exe

To reduce file size, compress the executable using upx ( )

./upx --lzma ./unetbootin.exe

Instructions (Microsoft Visual C++ 2005)

You can also use Microsoft Visual C++ 2005 as your compiler to reduce executable size for Windows. In that case, download and use:


To build, extract the file to C:\Qt\qt4-msvc2005, cd to the unetbootin source directory, open the Visual Studio 2005 command line and enter the following commands:

set QTDIR=c:\Qt\qt4-msvc2005
set PATH=%PATH%;c:\Qt\qt4-msvc2005\bin
set QMAKESPEC=win32-msvc2005
qmake "DEFINES += STATICWINDOWS" "RESOURCES += unetbootin-windows.qrc unetbootin-sevnz.qrc" "RC_FILE += ubnembed.rc"
upx --lzma release\unetbootin.exe

For more information see Compiling Qt Projects with Microsoft Visual C++

Instructions (Mac OS X)

Download and install XCode, and install the XCode Command Line Tools from there.

Next download qt4.8.7-mac-x86.tar.xz or qt4.6.4-mac-snowleopard.tar.xz

Extract qt4.6.4-mac-snowleopard.tar.xz using The Unarchiver, to get the directory qt4-mac. Then move the qt4-mac folder into the src/unetbootin directory (same one containing

Then go to the src/unetbootin directory and run ./build-mac


If you run into errors while running qmake or other qt build commands, make sure you're using the qt4 version not the qt3 one by adding -qt4 to the end of the commands (qmake-qt4). You can check the version by running "qmake --version".

If you get mingw errors relating to "qatomic-windows.h" or "InterlockedCompareExchange" open the file src/corelib/arch/qatomic_windows.h find this section and add the declarations:

extern "C" {
    __declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long);
    __declspec(dllimport) long __stdcall InterlockedIncrement(long *);
    __declspec(dllimport) long __stdcall InterlockedDecrement(long *);
    __declspec(dllimport) long __stdcall InterlockedExchange(long *, long);
    __declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long);

See Also

Development Guide
Building a Custom UNetbootin Version
Building a UNetbootin Plugin
List of Custom UNetbootin Versions and Plugins (publicly editable)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.