Hugin SDK (MSVC 2013)
This side contains some notes to compile Hugin with MS Visual Studio Community Edition 2013.
This instructions applies to build all libs as shared libraries (aka dll). All instructions refers to 32 and 64 bit except otherwise noted.
- 1 Prerequisites
- 2 Dependencies
- 3 Build Hugin
First install the following prerequisites:
- Visual Studio 2013 Community Edition:  (Please don't use the 2015 version. Not all needed libraries are updated for the new compiler generation.)
- CMake  (select win32 installer )
- Tortoise HG, to get code from repository  (select 32 or 64 bit, which one is appropriate for your system, not for the architecture you are building)
- MS HTML Help Workshop, for creating the help file 
- 7-zip, to extract some downloads 
- First create a directory, where we build all libraries and program. This directory is called SDKROOT in the following steps. It's best to use a directory without white spaces or other special characters, e.g. c:\huginSDK would be a good point. Replace SDKROOT with your real path in all places.
- There are mainly 2 build ways, depending on the library
- The CMake way
- The nmake way
In the following we will give only short instructions, and mention where differences to the general way are.
The CMake way
- Open the CMake (CMake-gui) from the start menu
- Browse to the path where you extracted the source
- Specify a path where the library is build. Normally use SDKROOT\build_lib (Replace lib with the name of the corresponding library.)
- Now select Configure, confirm directory creation, select Visual Studio 12 2013 for building 32 bit version or Visual Studio 12 2013 Win64 for the 64 bit version
- Tick option Advanced and Grouped to see all possible variables.
- When configure finished with error, edit some variables as described in the individual section. (If the variables does not exists after configure, create it Add entry.) Then press configure again.
- Repeat until CMake reports Configuring done and there are no red keys in the GUI.
- Now select Generate
- Open the generated project file (xxx.sln) in the build folder
- In Visual Studio check that on the top there is selected Release and Win32 (for 32 bit Hugin) or x64 (for 64 bit Hugin).
- Select the project INSTALL, open context menu (right menu button) and select Build
- Now VS builds the lib and copies all necessary files to the install destination.
The nmake way
- Open Start>Visual Studio 2013>Visual Studio Tools
- Start VS2013 x86 Native Tools Command Prompt (for 32 bit) or VS2013 x64 Native Tools Command Prompt (for 64 bit)
- Switch to the path where you extracted the source
- Now build the library. The exact instructions are given in the approbate section.
- Download from  (.7z version is fine)
- Extract to SDKROOT\boost_1_58_0
- Now via the nmake way
cd SDKROOT\boost_1_58_0 bootstrap.bat
- Now build for 32 bit with
b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared stage
or for 64 bit
b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared address-model=64 stage
- Download from  Windows Source and extract source to SDKROOT\wxWidgets-3.0.2
- Also via the nmake way
- Now build for 32 bit
nmake -f makefile.vc BUILD=debug SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic nmake -f makefile.vc BUILD=release SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic
or for 64 bit
nmake -f makefile.vc BUILD=debug TARGET_CPU=AMD64 SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic nmake -f makefile.vc BUILD=release TARGET_CPU=AMD64 SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic
- Download zlib 1.2.8 from  and extract source to SDKROOT\zlib-1.2.8
- Now via the CMake way
- After configure change key
CMAKE_INSTALL_PREFIX = SDKROOT\zlib
- Now configure, generate, open project file and build INSTALL project (as described on top).
- Download libpng from  (e.g. zip version) and extract source
- Also via CMake
- Change the following keys:
CMAKE_INSTALL_PREFIX = SDKROOT\libpng PNG_SHARED [x] (selected) PNG_STATIC [ ] (not selected) ZLIB_INCLUDE_DIR = SDKROOT\zlib\include ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib
- Finish CMake steps.
- Download libjpeg from  and extract source.
- Open file makefile.vc in notepad and change the line
# Pull in standard variable definitions !include <win32.mak>
# Pull in standard variable definitions #include <win32.mak>
and save. Now open file jmorecfg.h and change the lines
/* a function referenced thru EXTERNs: */ #define GLOBAL(type) type /* a reference to a GLOBAL function: */ #define EXTERN(type) extern type
/* a function referenced thru EXTERNs: */ #define GLOBAL(type) __declspec(dllexport) type /* a reference to a GLOBAL function: */ #define EXTERN(type) extern __declspec(dllexport) type
and save again.
- Now open a Visual studio command prompt (as in the nmake way) and
cd SDKROOT\jpeg-9a nmake /f makefile.vc setup-v10
- Now open project file jpeg.sln in SDKROOT\jpeg-9a and confirm update of project files.
- For 64 bit only: Open combo box with Win32 and select Configuration Manager. Under active platform select New.. and choose then new Platform x64 and copy from Win32. (When build 32 bit version, this is not necessary.)
- Open context menu on jpeg project, select Properties. Under Properties, Configuration type switch from Static lib (.lib) to Dynamic lib (.dll). Close dialog.
- Open context menu on jpeg project again, now select Build.
- Download libtiff from  and extract source.
- Edit file nmake.opt in notepad. Change the lines
# # Uncomment and edit following lines to enable JPEG support. # #JPEG_SUPPORT = 1 #JPEGDIR = d:/projects/jpeg-6b #JPEG_INCLUDE = -I$(JPEGDIR) #JPEG_LIB = $(JPEGDIR)/Release/jpeg.lib # # Uncomment and edit following lines to enable ZIP support # (required for Deflate compression and Pixar log-format) # #ZIP_SUPPORT = 1 #ZLIBDIR = d:/projects/zlib-1.2.1 #ZLIB_INCLUDE = -I$(ZLIBDIR) #ZLIB_LIB = $(ZLIBDIR)/zlib.lib
# # Uncomment and edit following lines to enable JPEG support. # JPEG_SUPPORT = 1 JPEGDIR = SDKROOT/jpeg-9a JPEG_INCLUDE = -I$(JPEGDIR) JPEG_LIB = $(JPEGDIR)/Release/jpeg.lib # for 32 bit JPEG_LIB = $(JPEGDIR)/x64/Release/jpeg.lib # for 64 bit # # Uncomment and edit following lines to enable ZIP support # (required for Deflate compression and Pixar log-format) # ZIP_SUPPORT = 1 ZLIBDIR = SDKROOT/zlib/include ZLIB_INCLUDE = -I$(ZLIBDIR) ZLIB_LIB = SDKROOT/zlib/lib/zlib.lib
Keep in mind to replace SDKROOT with your full path (use normal slash / instead of backslash \). Also for JPEG_LIB leave only one entry (depending on architecture). Save.
- Now via the nmake way:
cd SDKROOT\libtiff-4.0.3 nmake Makefile.vc
- Download IlmBase from  and extract source.
- Via the CMake way, change the following keys
BUILD_SHARED_LIBS [x] (selected) CMAKE_INSTALL_PREFIX = SDKROOT\Deploy
- Finish CMake steps.
- Download OpenEXR from  and extract file.
- Via the CMake way, change the following keys
BUILD_SHARED_LIB [x] ILMBASE_PACKAGE_PREFIX = SDKROOT\Deploy CMAKE_INSTALL_PREFIX = SDKROOT\Deploy ZLIB_INCLUDE_DIR = SDKROOT\zlib\include ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib
- Open the project file and select build from the context menu of the IlmImf project. This will fail with an error message. Now copy all dll files from SDKROOT\Deploy\lib to build-OpenEXR\IlmImf\Release. Now try to build IlmImf again. Then build the INSTALL project.
- Download vigra from  and extract source
- Via the CMake way. Set the following keys
WITH_HDF5 [ ] WITH_OPENEXR [x] WITH_VALGRIND [ ] WITH_VIGRANUMPY [ ] CMAKE_INSTALL_PREFIX = SDKROOT\vigra
and set the following paths (you need to do it sequential, otherwise not all are displayed by default
ZLIB_INCLUDE_DIR = SDKROOT\zlib\include ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib
Press configure again. And now the second part
JPEG_INCLUDE_DIR = SDKROOT\jpeg-9a JPEG_LIBRARY = SDKROOT\jpeg-9a\Release\jpeg.lib (32 bit) JPEG_LIBRARY = SDKROOT\jpeg-9a\x64\Release\jpeg.lib (64 bit) PNG_PNG_INCLUDE_DIR = SDKROOT\libpng\include PNG_LIBRARY_RELEASE = SDKROOT\libpng\lib\libpng16.lib TIFF_INCLUDE_DIR = SDKROOT\tiff-4.0.3\libtiff TIFF_LIBRARY = SDKROOT\tiff-4.0.3\libtiff\libtiff_i.lib OPENEXR_INCLUDE_DIR = SDKROOT\Deploy\include
and for all OpenExr libraries (Half, IEx, IlmImf, Ilmthread, Imath) do the same (replace ? with the real names, some lib can contain an additional version number like -2_2)
OPENEXR_?_LIBRARY = SDKROOT\Deploy\lib\?.lib
- Configure, Generate, open project file and build INSTALL project.
- Load expat 2.1.0 source from  and extract.
- The expat library is build with the exiv2 library. So no additional steps are needed.
- Download exiv2 source package from  and extract.
- Open project file SDK\exiv-0.24\msvc2012\exiv2.sln and confirm upgrade.
- Switch to ReleaseDLL and Win32 or x64.
- Delete zlib1 project (from the context menu). We have already build the zlib library and are using our compiled version.
- Open context menu on exiv2lib, select properties, go to Configuration properties. Under C/C++ > General > Additional Include directories change (drop down the box and select edit)
Under Linker > Input > Additional dependencies change
And a last change under Build event > Prebuild event > Command Line remove the last part
copy/y "$(SolutionDir)zlib\$(Platform)\$(Configuration)\*.dll" "$(OutDir)"
and close dialog.
- Then build the exiv2lib project.
- Download the sqlite-amalgamation and sqlite-dll-win32 from  and extract both files to SDKROOT\sqlite3
- Via the nmake way. For 32 bit version use
cl /D_USRDLL /D_WINDLL /MD /D_MBCS /DSQLITE_ENABLE_COLUMN_METADATA /D"SQLITE_API=extern __declspec(dllexport)" sqlite3.c /link /DLL /OUT:sqlite3.dll lib /def:sqlite3.def
or for the 64 bit version
cl /D_USRDLL /D_WINDLL /MD /D_MBCS /DSQLITE_ENABLE_COLUMN_METADATA /D"SQLITE_API=extern __declspec(dllexport)" sqlite3.c /link /DLL /OUT:sqlite3.dll lib /def:sqlite3.def /machine:x64
- Download gettext Binaries and Dependencies from  (The same version can be used for 32 and 64 bit version. We need only the binaries during building of Hugin.)
- Create the directory SDKROOT\gettext and extract both files to this folder.
- Download exiftool  (select Windows Executable)
- Create the directory SDKROOT\exiftool
- Decompress the file to this folder and rename exiftool(-k).exe to exiftool.exe
- Download enblend/enfuse (32 or 64 bit version, should be match with Hugin architecture) from  and extract the archive (e.g. SDKROOT\enblend-enfuse-4.1.3-Win32 or SDKROOT\enblend-enfuse-4.1.3-Win64)