Compile LZO source code



Web site : http://www.oberhumer.com/
Source code : http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz
Version : 2.09


Table Of Contents

  1. Compile Qt LZO using Windows Visual Studio


Compile Qt LZO using Windows Visual Studio

There are 8 modes when using Windows Visual Studio :

Decompress the LZO source file

The source tarbll lzo-2.09.tar.gz can be found in QtLzo/3rdparty/souces, after decompress lzo-2.09.tar.gz, there will be a lzo-2.09 directory.

In the parallel directory with lzo-2.09 :

mkdir lzo
cd lzo

Windows Visual Studio x64 ( Static , Debug )

cmake -G "VIsual Studio 12 Win64" ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_SHARED, enable ENABLE_STATIC, then Configure, and Generate.

This will generate Visual Studio sln file, then open lzo.sln with Visual Studio, select Debug, then compile.

Windows Visual Studio x64 ( Static , Release )

cmake -G "VIsual Studio 12 Win64" ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_SHARED, enable ENABLE_STATIC, then press Configure, and Generate.

This will generate Visual Studio sln file, then open lzo.sln with Visual Studio, select Release, then compile.

Windows Visual Studio x64 ( DLL , Debug )

cmake -G "VIsual Studio 12 Win64" ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_STATIC, enable ENABLE_SHARED, and press Configure, then Generate, this will create Visual Studio sln file.

Open lzo-2.09/include/lzo/lzoconf.h with text editor, at about line 220 :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1         /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Modify into :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1 __declspec(dllexport) /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Open up lzo.sln with Visual Studio, select Debug, then compile.

Windows Visual Studio x64 ( DLL , Release )

cmake -G "VIsual Studio 12 Win64" ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_STATIC, enable ENABLE_SHARED, and press Configure, then Generate, this will create Visual Studio sln file.

Open lzo-2.09/include/lzo/lzoconf.h with text editor, at about line 220 :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1         /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Modify into :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1 __declspec(dllexport) /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Open up lzo.sln with Visual Studio, select Release, then compile.

Windows Visual Studio x86 ( Static , Debug )

cmake ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_SHARED, enable ENABLE_STATIC, then press Configure, and Generate.

This will generate Visual Studio sln file, then open lzo.sln with Visual Studio, select Debug, then compile.

Windows Visual Studio x86 ( Static , Release )

cmake ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_SHARED, enable ENABLE_STATIC, then press Configure, and Generate.

This will generate Visual Studio sln file, then open lzo.sln with Visual Studio, select Release, then compile.

Windows Visual Studio x86 ( DLL , Debug )

cmake ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_STATIC, enable ENABLE_SHARED, and press Configure, then Generate, this will create Visual Studio sln file.

Open lzo-2.09/include/lzo/lzoconf.h with text editor, at about line 220 :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1         /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Modify into :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1 __declspec(dllexport) /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Then open up lzo.sln with Visual Studio, select Debug, then compile.

Windows Visual Studio x86 ( DLL , Release )

cmake ..\lzo-2.09
cd ..
cmake-gui lzo

Disable ENABLE_STATIC, enable ENABLE_SHARED, then press Configure, and Generate, this will create Visual Studio sln file.

Open lzo-2.09/include/lzo/lzoconf.h with text editor, at about line 220 :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1         /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Modify into :

/* DLL export information */
#if !defined(__LZO_EXPORT1)
#  define __LZO_EXPORT1 __declspec(dllexport) /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
#  define __LZO_EXPORT2         /*empty*/
#endif

Then open up lzo.sln with Visual Studio, select Release, then compile.


Neutrino International Inc. 2001~2015