Welcome, Guest! Log In | Create Account

Visual Studio 2008 Project Setup

From delta3d

Jump to: navigation, search

After a successful Delta3D-buildwith Visual Studio 2008 you are ready to create a new project!
Note: you may wish to use the Delta3D Visual Studio Project Wizards, to automate the process of creating a new project.

Contents

1. Create an empty project

image:Vs2008_newproject.jpg

2. General Properties

Right click the project in the solution explorer and go to the Properties (Property Pages)
image:Vs2008_projectsettings_general.jpg
In the General-section you can define the Output Directory and Intermediate Directory.

  • Output Directory: location where the binaries will be placed
  • Intermediate Directory: location where .obj and other files are placed that are needed for compiling/building. (I always place this directory to a different location to keep the output directory clean.)

If you edit this values with the help of the <Edit>... -dialog (in dropdown-menu) you can take advantage of the many path- and name-makros that VisualStudio provides.


3. C/C++ Properties

Important: To enter these pages you have to add an C/C++-file to your project first!

image:Vs2008_projectsettings_c_1.jpg
Set the Additional Include Directories:

  • Add "$(DELTA_INC)".
  • If you have OSG located outside the Delta3D-Root add sth. like "$(OSG_ROOT)\include" or where ever your OSG-includes are placed.

( $(NAME) is replaced with the value of the related environment-variable )
Now, every time you use "include <XXX>" (with brakets instead of quotes) the compiler searches the Additional Include Directories automatically and you don't have to add the full paths. E.g. you can use "#include <dtCore/Globals.h>" instead of "#include "C:\Programs\Delta3D\include\dtCore\globals.h" ".


image:Vs2008_projectsettings_c_2.jpg
Set Preprocessor Definitions:

  • Add "WIN32" to Release and Debug configuration
  • Add "_DEBUG" to Debug configuration (e.g. use "#ifdef(_DEBUG) ... #endif" in code to distinguish a Debug-build)

4. Linker Properties

image:Vs2008_projectsettings_linker_1.jpg
Set Additional Library Directories:

  • Add "$(DELTA_LIB)".
  • If you have OSG located outside the Delta3D-Root add sth. like "$(OSG_ROOT)\lib" or where ever your OSG-libraries are placed.

Again, be sure that there are no quotes around those environment-entries.


image:Vs2008_projectsettings_linker_2.jpg
Set Additional Dependencies:

  • Add the Delta3D and OSG libraries your are using.
  • "dtCored.lib dtUtild.lib dtABCd.lib dtGamed.lib dtDALd.lib dtActorsd.lib osgd.lib osgDBd.lib" is always a good start ;-)

Note: If you distributing your application on a PC without Delta3D installed, you have to copy the related dll for each lib in your Output Directory

5. Copy Configurations

Copy all values (expect "_DEBUG" in Preprocessor Definitions) to the Relase-configuration and everything should be fine