» home
» bugs
» git
 
Only the instructions for Visual C++ 2010 are recent. The rest of this article is old and might not be entirely correct any longer!
You can get the latest build instructions for CVS 0.24.x here:

Compiling Litestep 0.24.x

Visual C++ 2010

Build requirements

This is the configuration used during 0.24.8 development, it is quite possible that other versions of the above packages can be used, but there's no guarantee.

Build Setup

A. Install VC++ 2010 Express & The Platform SDK

If you don't have the build requirements installed, download them. Install Visual C++ 2010 Express. Restart when asked and then install the SDK which should register automatically with VC++.

It is helpful to select "Expert Settings" in VC++ 2010 Express. See Tools –> Settings –> Expert Settings.

B. Install libpng and zlib

The following instructions explain how to build the libpng and zlib libraries from source code. However, all you need to build the LiteStep source code are the files libpng13.lib, png.h, pngconf.h, zlib.h and zconf.h placed in your LIB and INCLUDE paths respectively. LiteStep links against libpng13.lib (for debug builds libpng13d.lib) and only includes png.h.

Note Building lpng1235 and zlib123 with VC++ 2010 Express is untested at this time. If you use the libpng and zlib zipfile in the requirements you wont need to build them.

Building LiteStep

A. Extract source code

  1. Create a build directory for the source code (LiteStep, for example).
  2. Extract the source code into the build directory. So that the build directory has the following structure:
    \LiteStep 
      \hook
      \litestep 
      \lsapi 
      \utility 
    
  3. Extract lsdev-builddeps.zip

B. Convert

Open "litestep_vc71.sln" in VC++ 2010 Express. Answer OK or Next to all the stages of the conversion wizard.

C. Compile

  1. Go to the Property Manager and expand the Debug and Release trees of "lsapi". Ctrl select "Microsoft.Cpp.Win32.user in both trees, then right click and select properties. Add the include directory to Common Properties –> VC++ Directories –> Include Directories that you extracted from the lsdev-builddeps archive. Do the same for the lib directory (General –> Library Directories).\\For those familiar with the previous way of doing this see http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-p… (search for "3) VC++ Directories change").
  2. Replace references to "afxres.h" with "windows.h" in "hook\hook.rc", "litestep\litestep.rc" "lsapi\lsapi.rc". MFC is not used by Litestep meaning that afxres.h can be safely replaced.
  3. Add the following to litestep/resource.h
    #ifndef IDC_STATIC
    #define IDC_STATIC -1
    #endif
    The IDC_STATIC definition is usually defined in MFC. The definition has simply been copied from there.
  4. Use the Configuration Manager (Right click on "Solution" in the Solution Explorer) to switch between Debug and Release builds.
  5. Select "Build Solution" to begin compiling.
  6. The binaries are located at .\LiteStep\Release_VC71 and .\LiteStep\Debug_VC71 for Release and Debug configurations respectively.

Visual Studio 6.0 and 7.1

The following article is old and might not be entirely correct any longer! FIXME

This articles describes what you need to prepare your build environment and compile Litestep with Visual Studio.

Introduction

These are the build instructions for LiteStep and Microsoft Visual C++ 6.0 or 7.1 (aka MSVC .NET 2003). If you want to use MSVC 7.0 (.NET 2002) you can follow the instructions for version 7.1 below, but you will have to convert the workspace and project files yourself. You can find a neat utility at the following codeproject page which makes the conversion easier. http://www.codeproject.com/KB/macros/vsconvert.aspx

The following components are required to compile Litestep. This article will guide you through the installation and configuration processes. You only have to do this once.

  • MS Visual Studio 6.0sp6 or 7.1 (aka .NET 2003)
  • MSVC 6 only: Platform SDK from February 2003
  • libpng
  • zlib

This is the configuration used during LiteStep development. It should generally be no problem to use other, more recent versions of the above libraries, but there's no guarantee.

If you encounter any problems using these instructions please contact us on our Mailing Lists or IRC channels.

Preparations

Note 1: The instructions below will ask you to "add directory abc to MSVC's xyz files". The location of the directories dialog is slightly different in MSVC 6 and 7.1. In both versions you need to open the "Tools" menu and select "Options". In MSVC 6, go to the "directories" tab. In MSVC 7.1 you need to select "Projects→VC++ Directories".

Note 2: It is very important that you keep the following installation/configuration order.

A. Updating Visual Studio

It is assumed that Visual Studio is already installed.

MSVC 6:

It is required that Visual C++ 6 with Service Pack 5 and 6 are installed. You may download the required Service Packs using the links below.

Note: Before applying Service Pack 6, ensure that Service Pack 5 has been installed, otherwise your setup will be broken.

Service Pack 5 download link

Service Pack 6 download link

It is also recommended to apply the fixes detailed here: http://www.dinkumware.com/vc_fixes.html

MSVC 7.1 (.NET 2003):

MSVC 7.1 already comes with a decent STL implementation and includes a fairly recent Platform SDK. Thus you can skip the "Installing the Platform SDK" section.

B. Installing the Platform SDK (MSVC 6 only)

The Platform SDK includes the latest headers for the Windows API. For example they enable you to use previously undocumented APIs.

  1. Go to this web page to download the Platform SDK. The February 2003 release of the Platform SDK is the latest version that works with VC6.
  2. Make sure MSVC is closed.
  3. In the web-based installer that starts when you run setup.exe, choose Downloads → Install in the top menu. Select the components you want to install. The minimum requirements are the build environment of the Core SDK and "register environment variables".
  4. Make sure VC6 has been run at least once since you installed it before you perform the next step.
  5. The Platform SDK will create an entry in your start menu. There you'll find a subfolder called "Visual Studio Registration." Click on the entry "Register PSDK Directories with Visual Studio".
  6. To check if the directory registration was successful open Visual Studio. In the directories dialog the top entries in "Include Files", "Executable Files", and "Library Files" should refer to the Platform SDK directory.

C. Installing libpng and zlib

  1. Go to the libpng (http://www.libpng.org/pub/png/libpng.html) and zlib (http://www.zlib.org/) home pages and download the respective sourcecode (~620 KB + ~570 KB zipped). If you are presented with multiple download packages choose the latest package marked as "stable".
    Important: Get the zip files, not tar.gz or tar.bz2.
  2. Extract the sourcecode to two directories "libpng" and "zlib", for example "C:\Code\Libraries\libpng" and "C:\Code\Libraries\zlib". (make sure the directories are called "libpng" and "zlib" instead of "lpng124" or "zlib114" or something else).
  3. MSVC 6: Open the libpng\projects\visualc6\libpng.dsw MS VC++ workspace.
    MSVC 7.1: Open the libpng\projects\visualc71\libpng.sln MSVC 7.1 solution file.
  4. Add the libpng and zlib directories (in the example C:\Code\Libraries\libpng and C:\Code\Libraries\zlib) to the "Include Files".
  5. MSVC 6: In the "Build" menu select "Set Active Configuration" and choose "libpng - Win32 DLL Release".
    MSVC 7.1: FIXME
  6. Hit F7 to compile.
  7. MSVC 6: Repeat steps 6 and 7 for the "libpng - Win32 DLL Debug" configuration.
    MSVC 7.1: FIXME
  8. MSVC 6: In libpng\projects\visualc6\ you should now find the two subdirectories "Win32_DLL_Release" and "Win32_DLL_Debug" containing .lib files. Add these two directories to MSVC's "Library Files". In zlib\projects\visualc6\ you should find the same directories, add these as well.
    MSVC 7.1: FIXME

Building Litestep

A. Get the source

The cvs article explains how you can get the source if you don't have it already.

Once you have the sourcecode extract it to a directory called "litestep", e.g. "C:\Code\Litestep". The directory name "litestep" is not crucial for compiling, but it might help should you ever want to compile Litestep modules as well. Don't be confused by the fact that there's another directory called "litestep" (e.g. "C:\Code\Litestep\Litestep") inside your new "litestep" directory, it's for the litestep.exe project.

B. Compiling

  1. MSVC 6: Open the litestep.dsw (not .dsp!) MSVC workspace.
    MSVC 7.1: Open the litestep.sln "solution" file (aka workspace).
  2. MSVC 6: In the "Build" menu select "Set Active Configuration" and choose "litestep - Win32 Release".
    MSVC 7.1: In the "Build" menu select "Configuration Manager" and choose "Release" as the active configuration.
  3. Press F7 or select "Build litestep.exe" in the "Build" menu to start compiling.
  4. The output directory is litestep\litestep\Release, there you should find the files "hook.dll", "litestep.exe", and "lsapi.dll". If that is the case you have successfully compiled LiteStep.

Dev-C++

This article is old and might not be entirely correct any longer!
So, FIXME

Find out how you can compile LiteStep with the free Dev-C++/MinGW package.

Introduction

These are the build instructions for LiteStep 0.24.7 and Dev-C++. Dev-C++ is an open source IDE which includes the MinGW package. It allows you to compile Litestep with free tools only. Check the articles section for build instructions using other compilers.

If you encounter any problems using these instructions please contact us on our Mailing Lists or IRC channels.

Preparations

A. Installing Dev-C++

  1. Download Dev-C++. At the time this was written, the latest available version was 4.9.8.0, the rest of this document thus applies to this version. Make sure to get the full version (devcpp4980.exe) and not the update (devcpp4980exe.exe).
  2. Install Dev-C++ on your computer. Choose the "typical" installation type if you're not sure what the options mean.
  3. Launch Dev-C++. Select "Check for Updates/Packages" in the Tools menu. Update your Dev-C++ setup and get the Image Libraries Devpack. Note that you may have to restart Dev-C++ and the update procedure several times to get the latest updates.
  4. Open "Compiler Options" from the Tools menu. In the "Compiler" tab add -fmessage-length=0 to "Add the following commands when calling compiler".
    Add -s to the linker command line below.
  5. In the Settings tab choose Code generation and enable exception handling. Next, choose Linker and set Do not create console window to yes. Then click through the optimizations options and enable perform minor optimizations and best optimization.

B. Updating MinGW (optional)

Dev-C++ 4.9.8.x includes gcc 3.2.3, which produces quite large binaries compared to MSVC. If this worries you you can follow these instructions, which will bring gcc to version 3.3.1. The resulting binaries will still be larger than the MSVC binaries (about twice the size), but significantly smaller than what 3.2.3 produces.

  1. Download the latest "stable" gcc-core and gcc-g++ files. At the time this was written, they were gcc-core-3.3.1-20030804-1.tar.gz and gcc-g++-3.3.1-20030804-1.tar.gz (~2 MB each). You could also experiment with the GCC "Candidate" builds.
  2. Make sure Dev-C++ is closed. Create a backup of the current "bin", "include, and "lib" directories of Dev-C++, just in case.
  3. Extract the two downloaded archives into the Dev-C++ directory, preserving the directory structure. Overwrite any existing files.
  4. Open Dev-C++. Open Package Manager from the Tools menu.
  5. Select Install Package in the Package menu. Navigate to the "Packages" subdirectory of the Dev-C++ directory.
  6. Open and thus reinstall ImageLib.DevPak and any other DevPacks you had installed.

C. Get strsafe.h

The Litestep source currently depends on strsafe.h, a file included in recent Platform SDKs. MinGW does not provide this file. There is no separate download of this file, you thus need to download a 25 MB archive for a 200 KB file.

  1. From the PSDK cab, extract CoreSDK-common.2.0.cab. Then extract strsafe.h from CoreSDK-common.2.0.cab. Note that the filename appears to include some GUID, for example strsafe_h.B2667971_C6D3_11D2_9CB0_00C04FA36BAA. Rename it to strsafe.h.
  2. Copy strsafe.h to the "include" subdirectory of the Dev-C++ directory.
  3. Delete the downloaded file and all extracted files.

Building Litestep

A. Get the source

The cvs article explains how you can get the source if you don't have it already.

Once you have the sourcecode extract it to a directory called "Litestep", e.g. "C:\Code\Litestep". The directory name "Litestep" is not crucial for compiling, but it might help should you ever want to compile Litestep modules as well. Don't be confused by the fact that there's another directory called "litestep" (e.g. "C:\Code\Litestep\Litestep") inside your new "Litestep" directory, it's for the litestep.exe project.

B. Compiling

  1. Make sure Dev-C++ is closed. Run create_dirs.bat. It will create the output directories for Dev-C++. This is necessary to work around a Dev-C++ bug, it fails to create these directories itself.
  2. Open the utility.dev workspace in Dev-C++.
  3. Select Compile in the Execute menu.
  4. Repeat steps 2 and 3 for lsapi.dev, hook.dev. litestep.dev, in this order.
  5. You should find the files "hook.dll", "litestep.exe", and "lsapi.dll" in the output directory. If that is the case you have successfully compiled LiteStep.

Limitations

Binaries built with Dev-C++/MinGW currently suffer from a few limitations compared to binaries built with MSVC:

  • libpng is statically linked. This increases the size of lsapi.dll. However, libpng13.dll is thus no longer required to run Litestep.
  • No dialog resources. The aboutbox won't show up.
  • No string tables and thus no localized strings.
  • No file icon.

We hope to resolve these issues eventually.

 
lsdev/compiling_litestep.txt · Last modified: 2011/12/07 12:05 by acidfire
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki