Microsoft Visual C++ Build Instructions ======================================= Installing Visual C++ 2005 Express Edition: ------------------------------------------- This whole section can be skipped if you have Visual Studio 2005 (i.e. not the free Express edition) installed. To install Visual C++ 2005 Express Edition and the Microsoft Platform SDK, follow the steps described at the following URL: http://www.microsoft.com/express/2005/platformsdk/default.aspx In order for the Visual Studio Command Line Compiler to find the necessary Microsoft Platform SDK files, one more file must be modified: open "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" in an editor and add the following lines at the top, after "@echo off": @set PATH=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin;%PATH% @set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include;%INCLUDE% @set LIB=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;%LIB% The Easy Way: ------------- Atomic Labs has a zip file available from the "Third Party Libraries" page on our website that contains all of the required libraries to build Pion for MSVC 2005. To get started quickly, just download and uncompress this file into your C:\ directory, and you should be able to skip most of the following instructions (however, Path and VC++ directory updates are still required). Building Boost: --------------- First, download and unzip the Boost 1.35.0 (or later) source code from: http://sourceforge.net/project/showfiles.php?group_id=7586 (Click on boost_1_35_0.zip, or similiar) We recommend that you use the bjam tool to build Boost for MSVC. You can download the latest bjam executable from: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941 (Click on boost-jam-3.1.16-1-ntx86.zip, or similar) Copy the included "bjam" executable into your C:\Windows\System32 directory. Open the Visual Studio 2005 Command Prompt, change to the Boost source code directory, and type: bjam --toolset=msvc debug release threading=multi stage Or, if you wish to build only the libraries required by Pion (this saves a little time and disk space but not a whole lot): bjam --toolset=msvc --with-thread --with-system --with-filesystem \ --with-regex --with-date_time --with-unit_test_framework \ --with-signals debug release threading=multi stage Boost.Iostreams is also required, but must be compiled separately for Windows; see Building Boost.Iostreams below. We recommend that you create a C:\Boost directory with C:\Boost\Lib and C:\Boost\Include subdirectories. To install Boost into these directories, just copy the files in stage/lib into C:\Boost\Lib, and copy the entire boost/ directory into C:\Boost\include\boost-1_35. Update the Visual C++ Directories in the Projects and Solutions section in the Options dialog box. For Include files add "C:\Boost\Include\boost-1_35", and for Library files add "C:\Boost\Lib". Finally, we suggest adding C:\Boost\Lib to your Path. Building Boost.Iostreams: ------------------------- Boost.Iostreams is built by default without compression/decompression support on Windows (since zlib and bzip2 aren't installed as part of Windows.) Since Pion uses boost::iostreams::gzip_decompressor and boost::iostreams::bzip2_decompressor, zlib and bzip2 must be installed (see instructions later in this document) and Boost.Iostreams must be rebuilt: open a command prompt in ...\boost_1_35_0\libs\iostreams\build, and run the following command (changing the paths if you installed zlib and/or bzip2 elsewhere.) bjam debug release -sZLIB_BINARY=zdll -sZLIB_INCLUDE=C:/zlib-1.2.3/include \ -sZLIB_LIBPATH=C:/zlib-1.2.3/lib -sBZIP2_BINARY=bzip2 \ -sBZIP2_INCLUDE=C:/bzip2-1.0.5/include -sBZIP2_LIBPATH=C:/bzip2-1.0.5/lib Then copy boost_iostreams-vc80-mt-gd-1_35.{dll|lib} and boost_iostreams-vc80-mt-1_35.{dll|lib} from ...\boost_1_35_0\bin.v2\libs\iostreams\build to C:\Boost\Lib. Installing OpenSSL: ------------------- ASIO requires OpenSSL for SSL/TLS encryption support. You can get Win 32 binaries for OpenSSL from: http://www.pion.org/files/openssl-0.9.8g.win32.zip Unzip directly into C: (or change OPENSSL_HOME accordingly.) If you want to build them yourself, you can get the source tarball from: http://www.openssl.org/source/openssl-0.9.8g.tar.gz Build the static versions of ssleay32 and libeay32 (by using nt.mak rather than ntdll.mak, as explained in INSTALL.W32). Pion expects them to be in $(OPENSSL_HOME)\lib, where OPENSSL_HOME is C:\openssl-0.9.8g unless you've changed it. Note: While configuring OpenSSL for build, use the following command: perl Configure VC-WIN32 --prefix=C:\\OpenSSL (note double "\\" required by windows ) Pion is currently set up to link to ssleay32d.lib and libeay32d.lib for the debug configuration; the easiest way to get these files is from the above zip file. Note that if you try to use the release versions of ssleay32.lib and libeay32.lib with a debug configuration of Pion, you will probably have trouble running the unit tests, due to msvcr80.dll and msvcr80d.dll being loaded at the same time. (Yes, this is even true for the static versions.) If you want to use the DLL versions, they are also included in the above zip file. You will need to add C:\openssl-0.9.8g\bin to your path, and follow the instructions in the next section. (If you build them yourself, the same caveats about the debug versions apply.) Linking with OpenSSL: --------------------- Macro OPENSSL_HOME in pion.vsprops is set to C:\openssl-0.9.8g. If you installed OpenSSL somewhere other than C:\openssl-0.9.8g, change OPENSSL_HOME accordingly. By default, Pion links with the static versions, which should be in $(OPENSSL_HOME)\lib. To link with the DLL versions, you will have to change $(OPENSSL_HOME)\lib to $(OPENSSL_HOME)\bin in common\build\Release_DLL_pion.vsprops, common\build\Debug_DLL_pion.vsprops and platform\server\pion.vcproj. Include PION_HAVE_SSL or PION_FULL in Preprocessor Definitions for the project, or in PionConfig.hpp.win, uncomment '#define PION_HAVE_SSL'. (The Debug_DLL_full and Release_DLL_full configurations have PION_FULL defined.) Logging frameworks: ------------------- Note that the use of a logging framework is entirely optional, so you may skip this step if you like. If no logging option is defined, std::cout and std::cerr will be used for logging. To disable logging, include PION_DISABLE_LOGGING in Preprocessor Definitions for the project, or in PionConfig.hpp.win, uncomment '#define PION_DISABLE_LOGGING'. At this time, log4cxx (http://logging.apache.org/log4cxx) is the only supported logging library that builds correctly under Windows. A binary distribution is available at http://pion.org/files/apache-log4cxx.win32.zip. Install it in C:\apache\apache-log4cxx-0.10.0, or change user macro LOG4CXX_HOME in pion.vsprops, currently set to C:\apache\apache-log4cxx-0.10.0, accordingly. Add \bin to your path. Include PION_USE_LOG4CXX or PION_FULL in Preprocessor Definitions for the project, or in PionConfig.hpp.win, uncomment '#define PION_USE_LOG4CXX'. SQLite (optional): ------------------ Building SQLiteDatabase requires SQLite (http://www.sqlite.org/). A binary distribution is available at http://www.pion.org/files/SQLite-3.5.8.win32.zip. Unzip directly into C: (or change SQLITE_HOME accordingly) and add C:\SQLite-3.5.8\lib to your path SQLiteDatabase is only built in the Debug_DLL_full and Release_DLL_full configurations of pion-platform.sln. JSON (optional): ---------------- Building JSONCodec requires YAJL (http://lloydforge.org/projects/yajl/). A binary distribution is available at http://pion.org/files/yajl-0.4.0.win32.zip. Unzip directly into C: (or change JSONCodec.vcproj accordingly) and add C:\yajl-0.4.0\bin to your path JSONCodec is only built in the Debug_DLL_full and Release_DLL_full configurations of pion-platform.sln. Additional libraries (required for PLATFORM build) -------------------------------------------------- zlib: - download http://xmlsoft.org/sources/win32/zlib-1.2.3.win32.zip - open it into C:\zlib-1.2.3 - add C:\zlib-1.2.3\bin to your path - (if installed somewhere other than C:\zlib-1.2.3, change user macro ZLIB_HOME in pion.vsprops accordingly) iconv: - download http://xmlsoft.org/sources/win32/iconv-1.9.2.win32.zip - open it into C:\iconv-1.9.2\ - add C:\iconv-1.9.2\bin to your path libxml: - download http://xmlsoft.org/sources/win32/libxml2-2.6.30.win32.zip - open it into C:\libxml2-2.6.30\ - add C:\libxml2-2.6.30\bin to your path - (if installed somewhere other than C:\libxml2-2.6.30, change user macro LIBXML_HOME in pion.vsprops accordingly) bzip2: - download http://gnuwin32.sourceforge.net/downlinks/bzip2-bin-zip.php - open it into C:\bzip2-1.0.5 - add C:\bzip2-1.0.5\bin to your path - (if installed somewhere other than C:\bzip2-1.0.5, change user macro BZIP2_HOME in pion.vsprops accordingly) Building and installing Pion: ----------------------------- Now you should be able to build the solution file called pion-.sln. See platform/server/README.msvc for more information about running Pion. Running the test programs: -------------------------- Make sure "C:\Boost\Lib" is on your path. If you got the source code from the Subversion repository and haven't yet run Doxygen, then create the documentation files (used as part of the Pion Network Library tests) as follows: cd \.. doxygen net\doc\Doxyfile Alternatively, just create file "\doc\html\index.html": pion-net Documentation

pion-net Documentation

Otherwise, PionWebServer and unit tests fail with "no such directory" error. To test PionWebServer, try running it from "\utils\" with the following command line args: -c testservices.conf To run from within the IDE, go to PionWebServer Property Pages -> Debugging, and set 'Command Arguments' to the above.