CHDK Wiki
Register
mNo edit summary
Line 1: Line 1:
 
DNG for PowerShot-2 ([[DNG4PS-2]]) sources are publicly available on the [http://dng4ps2.chat.ru/index_en.html DNG4PS-2 homepage]. The build advice below is based upon conversations with the author and experience with:
 
DNG for PowerShot-2 ([[DNG4PS-2]]) sources are publicly available on the [http://dng4ps2.chat.ru/index_en.html DNG4PS-2 homepage]. The build advice below is based upon conversations with the author and experience with:
 
* Visual C++ 2008 Express
 
* Visual C++ 2008 Express
* DNG4PS-2 beta release 0.2.2beta-24 (20.04.2008)
+
* DNG4PS-2 beta release 0.2.3-beta12 (24.07.2008)
 
* Windows XP SP2.
 
* Windows XP SP2.
   

Revision as of 17:01, 15 August 2008

DNG for PowerShot-2 (DNG4PS-2) sources are publicly available on the DNG4PS-2 homepage. The build advice below is based upon conversations with the author and experience with:

  • Visual C++ 2008 Express
  • DNG4PS-2 beta release 0.2.3-beta12 (24.07.2008)
  • Windows XP SP2.

Pre-Requisites

The readme_en.txt files lists a number of pre-requisites

  1. wxWidgets library (http://www.wxwidgets.org/).
  2. Boost library (http://www.boost.org/)
  3. RAD tool "Code::Blocks" (http://www.codeblocks.org/). Newest nightly build are required
  4. If you want to compile under MS Windows, install MinGW (CGG compiler for Windows) with gettext module (http://www.mingw.org/).

In practice the last two pre-requisites are not mandatory. They are only required when performing GUI modifications or building executables for non-Windows platforms. On Windows the program can be built using Visual C++ 2008 Express, Boost and wxWidgets.

Build Libraries

Boost

The Boost C++ Libraries can be downloaded from here. Current version at time of writing was v1.35.0, with a download size of ~42mb, unpack/build size of ~220Mb, and install size of ~44Mb (include files and libraries).

Instructions on this site are straightforward, though the patching step (for VC++ 2008 Express compatibility) is no longer required with v1.35.0.

An adaptation of the key steps follows:

In a command prompt execute the following:

"%VS90COMNTOOLS%vsvars32.bat"
REM Change BOOSTROOT to reflect unpack directory for the zip
SET BOOSTROOT=C:\temp\boost_1_35_0

REM Build bjam build program
cd /d "%BOOSTROOT%\tools\jam\src"
build.bat

REM Build Boost libraries then install
cd /d "%BOOSTROOT%"
tools\jam\src\bin.ntx86\bjam.exe
REM Change the value of the --prefix option to the location to install Boost
tools\jam\src\bin.ntx86\bjam.exe install --prefix=c:\boost_1_35_0\

wxWidgets

The wxWidgets library can be downloaded from here. Current version at time of writing was v2.8.7 and the preferred release is wxAll, with a download size of 18mb, unpack/build size of 2.11Gb (!!!), and install size of ~121Mb (include files and libraries).

Instructions on this site are straightforward, though need to be modified slightly to build the unicode versions of the libraries.

An adaptation of the key steps follows:

In a command prompt execute the following:

"%VS90COMNTOOLS%vsvars32.bat"

REM Change to reflect unpack location for the zip
cd /d "c:\temp\wxWidgets-2.8.7\build\msw\"
nmake -f makefile.vc BUILD=debug UNICODE=1
nmake -f makefile.vc BUILD=release UNICODE=1

Copy the include and lib subdirectories to a final location to finish the installation process.

Note:

By default the wxWidget library will be built using the Multi-threaded DLL runtime library. DNG4PS-2 is built using the Multi-threaded runtime library. The configuration of one of these two projects must be changed so both use the same runtime library, or errors such as the following will be encountered during linking:
msvcrt.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in libcmt.lib(malloc.obj) 

Build Program

Download the source files from the DNG4PS-2 homepage and unpack.

Create a text file called boost.vsprops and paste in the text below:

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
       ProjectType="Visual C++"
       Version="8.00"
       Name="boost"
       >
       <Tool
               Name="VCCLCompilerTool"
               AdditionalIncludeDirectories=""$(boost)\include\boost-1_35\";"$(boost)\include\boost-1_35\boost""
       />
       <Tool
               Name="VCLinkerTool"
               AdditionalLibraryDirectories=""$(boost)\lib""
       />
       <Tool
               Name="VCResourceCompilerTool"
               AdditionalIncludeDirectories=""$(boost)""
       />
</VisualStudioPropertySheet>
  1. Open the DNG4PS-2 project by double clicking on the DNG4PS-2.sln file.
  2. Right click on the DNG4PS-2 project in the tree view.
  3. Select Properties.
  4. For each configuration (debug and release) in the Configuration drop down list.
    1. Navigate to Configuration Properties -> C/C++ -> Code Generation in the tree view.
    2. Change the value of the Runtime Library setting to Multi-threaded DLL (/MD).
    3. Navigate to Configuration Properties -> Linker -> Input in the tree view.
    4. Remove libcmt.lib from the value of the Additional Dependencies setting.
    5. Select Apply.
  5. Select OK.
  6. Open the Property Manager using the View -> Property Manager menu item
  7. Right click on the DNG4PS-2 project in the tree view.
  8. Select Add Existing Property Sheet.
  9. In the file dialog, open the boost property sheet created above, then select OK.
  10. Close Visual C++ 2008 Express and save changes to the solution and project files when prompted.

In a command prompt execute the following:

"%VS90COMNTOOLS%vsvars32.bat"

REM Change environment variables to reflect install location for the libraries
SET WX=c:\wxWidgets-2.8.7\
SET BOOST=c:\boost_1_35_0\
"%VS90COMNTOOLS%..\..\VC\vcpackages\vcbuild.exe" DNG4PS-2.sln "Release|Win32"

Note:

Project configuration changed to use the Multi-threaded DLL runtime library and remove libcmt.lib, to prevent errors such as the following during linking:
msvcrt.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in libcmt.lib(malloc.obj)