Development Setup in Microsoft Windows XP

From CwWiki

Jump to: navigation, search

Before getting started, make sure your system having Microsoft Visual Studio 2003 or 2005 and Java Development Kit 5.0 Update 7 installed.

Download and build all of required libraries. Some of them come with Visual Studio project/solution files, so you can just use Visual Studio IDE to build. Others, you will need to start a Visual Studio command line window to use 'nmake' to build them, with some minor tweaks on the makefiles. We would like to build them all with static libraries.

One thing to remember: in "code generation" option, make sure all libraries use the same threading configuration, for example "multi-threaded' ( '/MT' option in 'cl.exe' parameter) In Visual Studio 2003, you would want it to be 'single-threaded' In Visual Studio 2005, since 'single-threaded' option is removed, then you would like it to be 'multi-threaded' in 'Code Generation option'

In the following procedures, using Microsoft Visual Studio 2005 is assumed.

Contents

Build Depedent Libraries

Download all required libraries source from URL provided in Corelyzer_Development. In the following document, we will assume all libraries are installed in "c:\lib" directory, and Corelyzer source code is downloaded and stored in "c:\dev\corelyzer" directory.

For your convenience, you can download the pre-built libraries pack from here.

http://www.evl.uic.edu/cavern/corewall/dev/prebuilt/lib.zip

After download the zip file, unzipped it the "c:\", then the Visual Studio solution file cocnfigurations will reflect libraries' path structure.

GL extension headers

Download and place them in the following path

c:\lib\gl_extensions\GL\glext.h
c:\lib\gl_extensions\GL\glxext.h
c:\lib\gl_extensions\GL\wglext.h


FreeType

  • Download and place in the following path
c:\lib\freetype-2.2.1

FreeType comes with Microsoft Visual Studio Solution file, so you can go ahead and open the project file for building the library. Look into directory

C:\lib\freetype-2.2.1\builds\win32\visualc

Visual Studio might ask you to convert it to newer format.

  • Bring up project property, in "Code Generation", "Runtime library" select "Multi-threaded (/MT)"
http://www.evl.uic.edu/cavern/corewall/dev/images/freetype-1.png
  • Rebuild the library
  • The result library will be placed in directory
C:\lib\freetype-2.2.1\objs

squish

Download and place in the following path

c:\lib\squish-1.5

squish comes with Microsoft Visual Studio Solution file, so you can go ahead and open the project file for building the library. Look into directory

C:\lib\squish-1.5\vs7

Visual Studio might ask you to convert it to newer format.

  • Bring up project property, in "Code Generation", "Runtime library" select "Multi-threaded (/MT)"
  • Rebuild the library
  • The result library will be placed in directory
C:\lib\squish-1.5\vs7\squish\Release

libjpeg

Download and place in the following path

c:\lib\jpeg-6b

The library does not come with Visual Studio IDE solution file. So you will need to build this from command line.

  • Start a "Visual Studio 2005 Command Prompt"; change directory to libjpeg directory
  • Copy a proper jpeg configuration header
copy jconfig.vc jconfig.h
  • Modify makefile.vc at around line 15 to like the following. Let compiler generate "Multi-Threaded" code
CFLAGS= $(cflags) $(cdebug) $(cvars) -I. /MT
  • Execute nmake to build the library
nmake /f makefile.vc
  • The result static library file will be in the same directory.

zlib

Download and place in the following path

c:\lib\zlib

The library will be need in building libpng and libtiff, for now you can just leave it here.


libpng

Download and place in the following path

c:\lib\lpng1210

libpng comes with Microsoft Visual Studio Solution file, so you can go ahead and open the project file for building the library. Look into directory

C:\lib\lpng1210\projects\visualc71

Visual Studio might ask you to convert it to newer format.

  • Bring up project property, in "Code Generation", "Runtime library" select "Multi-threaded (/MT)"
  • Remember to change both project "libpng" and "zlib"
  • Rebuild the library
  • The result library of libpng will be placed in directory
C:\lib\lpng1210\projects\visualc71\Win32_LIB_ASM_Release
  • The result library of zlib will be placed in directory
C:\lib\lpng1210\projects\visualc71\Win32_LIB_ASM_Release\ZLib

libtiff

Download and place in the following path

c:\lib\tiff-3.8.2

The library does not come with Visual Studio IDE solution file. So you will need to build this from command line.

  • Start a "Visual Studio 2005 Command Prompt"; change directory to libtiff directory
  • Modify "nmake.opt" to match your "zlib" and "libjpeg" paths. Lines you might need to change:
...
#
# Uncomment and edit following lines to enable JPEG support.
#
JPEG_SUPPORT	= 1
JPEGDIR 	= c:/lib/jpeg-6b
JPEG_INCLUDE	= -I$(JPEGDIR)
JPEG_LIB 	= $(JPEGDIR)/libjpeg.lib
...
#
# Uncomment and edit following lines to enable ZIP support
# (required for Deflate compression and Pixar log-format)
#
ZIP_SUPPORT	= 1
ZLIBDIR 	= c:/lib/zlib
ZLIB_INCLUDE	= -I$(ZLIBDIR)
ZLIB_LIB 	= $(ZLIBDIR)/zlib.lib
...
#
# Pick debug or optimized build flags.  We default to an optimized build
# with no debugging information.
# NOTE: /GX option required if you want to build the C++ stream API
#
OPTFLAGS =	/Ox /MT /GX /W3
#OPTFLAGS = 	/Zi 
  • Execute nmake to build the library
nmake /f makefile.vc
  • The result static library file will be in:
C:\lib\tiff-3.8.2\libtiff

Build Corelyzer

Native SceneGraph DLL library

In Corelyzer source, we bundle a Microsoft Visual Studio solution file, so you can use it to build the native library easily.

  • Go to the libscenegraph directory
C:\dev\corelyzer\win32\libscenegraph
  • Open project solution file with Visual Studio. Visual Studio might ask you to convert it to newer format.
  • In "General", correct "Additional Include Directories" if it doesn't match your dependent libraries paths.
http://www.evl.uic.edu/cavern/corewall/dev/images/additional_includes.png
  • Make it to generate "Dynamic Library(.dll)"
  • Make it "Multi-threaded (/MT)" in "Runtime Library" of "Code Generation"
  • In "Linker" -> "General", correct "Additional Library Directories" if it doesn't match your dependent libraries paths.
http://www.evl.uic.edu/cavern/corewall/dev/images/additional_libraries.png
  • In "Linker" -> "Input", correct "Additional Dependencies" if it doesn't match your dependent libraries names.
http://www.evl.uic.edu/cavern/corewall/dev/images/additional_dependencies.png
  • Select "rebuild" to build libscenegraph DLL library.


Pure Java Codes

Build with Visual Studio "nmake" command line tool

cd corelyzer\javasrc
nmake /f makefile.win32