Difference between revisions of "DOM guide: Setting up"

From COLLADA Public Wiki
Jump to navigation Jump to search
(prebuilt has no hyphen & some formatting tweaks)
Line 6: Line 6:
 
* Download the external libraries that the DOM uses
 
* Download the external libraries that the DOM uses
 
* If you are using VisualStudio .NET, set the appropriate configuration values
 
* If you are using VisualStudio .NET, set the appropriate configuration values
* Optionally build the COLLADA DOM (otherwise just use the distributed, pre-built version)
+
* Optionally build the COLLADA DOM (otherwise just use the distributed, already-built binary version)
 
{{editor|what= Include a discussion of how to build on Linux.}}
 
{{editor|what= Include a discussion of how to build on Linux.}}
  
Line 12: Line 12:
 
The COLLADA DOM is available royalty free and open source for download from SourceForge at http://sourceforge.net/projects/collada-dom.
 
The COLLADA DOM is available royalty free and open source for download from SourceForge at http://sourceforge.net/projects/collada-dom.
  
The COLLADA 1.4.1 DOM 1.3.0 is the latest release package. It comes in three varieties: a source-code-only distribution and two pre-built binary installers, one for Visual Studio .NET 2005 (VC8) and one for Visual Studio .NET 2003 (VC7).
+
The COLLADA 1.4.1 DOM 1.3.0 is the latest release package. It comes in three varieties:  
 +
* A source-code-only distribution
 +
* A binary installer for Visual Studio .NET 2005 (VC8)
 +
* A binary installer for Visual Studio .NET 2003 (VC7)
  
The COLLADA DOM is packaged for release only a few times a year. The latest COLLADA DOM code, containing the most recent bug fixes and features, can be downloaded directly from the Subversion repository on SourceForge. To grab the code from Subversion, you'll first need to download and install a Subversion client for your platform from http://subversion.tigris.org/project_packages.html. Then, open a console and run the command "svn co https://collada-dom.svn.sourceforge.net/svnroot/collada-dom/COLLADA_DOM/trunk collada_dom". That will download the latest copy of the COLLADA DOM to the directory "collada_dom".
+
The COLLADA DOM is packaged for release only a few times a year. The latest COLLADA DOM code, containing the most recent bug fixes and features, can be downloaded directly from the Subversion repository on SourceForge. To grab the code from Subversion, you'll first need to download and install a Subversion client for your platform from http://subversion.tigris.org/project_packages.html. Then, open a console and run the command:
 +
<nowiki>svn co https://collada-dom.svn.sourceforge.net/svnroot/collada-dom/COLLADA_DOM/trunk collada_dom</nowiki>
 +
That downloads the latest copy of the COLLADA DOM to the directory '''collada_dom'''.
  
 
===External Libraries===
 
===External Libraries===
Line 21: Line 26:
 
==Building Client Applications==
 
==Building Client Applications==
 
VisualStudio.NET requires additional path and dependency information to properly compile and link
 
VisualStudio.NET requires additional path and dependency information to properly compile and link
applications using the COLLADA DOM. Add the following information to your project:
+
applications using the COLLADA DOM.  
 +
 
 +
===Setting up include directories===
 +
Add the following information to your project:
 
*Add the following lines to the “Additional include directories” field in the "General" tab for the "C/C++" project configuration settings:
 
*Add the following lines to the “Additional include directories” field in the "General" tab for the "C/C++" project configuration settings:
 
  <COLLADA_DOM-path>\include
 
  <COLLADA_DOM-path>\include
 
  <COLLADA_DOM-path>\include\1.4
 
  <COLLADA_DOM-path>\include\1.4
 +
 +
===Linking with the static COLLADA DOM libararies===
 
The COLLADA DOM is provided as both static and dynamic link libraries.  
 
The COLLADA DOM is provided as both static and dynamic link libraries.  
*To link against the static COLLADA DOM libraries:
+
 
**Add the following lines to the "Additional library directories" field in the "General" tab for the "Linker" project configuration settings:
+
To link with the static COLLADA DOM libraries:
 +
*Add the following lines to the "Additional library directories" field in the "General" tab for the "Linker" project configuration settings:
 
  <COLLADA_DOM-path>\lib\vc8\1.4
 
  <COLLADA_DOM-path>\lib\vc8\1.4
 
  <libxml2, zlib, and iconv lib directory-path>  
 
  <libxml2, zlib, and iconv lib directory-path>  
**Add the following lines to the "Additional Dependencies" field in the "Input" tab for the "Linker" project configuration settings:
+
*Add the following lines to the "Additional Dependencies" field in the "Input" tab for the "Linker" project configuration settings:
 
  libcollada_dae.lib
 
  libcollada_dae.lib
 
  libcollada_dom.lib
 
  libcollada_dom.lib
Line 40: Line 51:
 
  zlib.lib
 
  zlib.lib
 
  wsock32.lib
 
  wsock32.lib
*To link against the dynamic COLLADA DOM library:
+
 
**Add the following line to the "Preprecessor Definitions" field in the "Preprocessor" tab for the "C/C++" project configuration settings:
+
===Linking with the dynamic COLLADA DOM library===
 +
To link with the dynamic COLLADA DOM library:
 +
*Add the following line to the "Preprecessor Definitions" field in the "Preprocessor" tab for the "C/C++" project configuration settings:
 
  DOM_DYNAMIC
 
  DOM_DYNAMIC
**Add the following line to the "Additional library directories" field in the "General" tab for the "Linker" project configuration settings:
+
*Add the following line to the "Additional library directories" field in the "General" tab for the "Linker" project configuration settings:
 
  <COLLADA_DOM-path>\lib\vc8
 
  <COLLADA_DOM-path>\lib\vc8
**Add the following line to the "Additional Dependencies" field in the "Input" tab for the "Linker" project configuration settings:
+
*Add the following line to the "Additional Dependencies" field in the "Input" tab for the "Linker" project configuration settings:
 
  libcollada141dom12.lib
 
  libcollada141dom12.lib
*If you are using Visual Studio .NET 2003 sunbstitute "vc7" for "vc8" in the "Additional library directories" field.
+
 
*To use the debug version of the libraries append "_d" to the end of the COLLADA DOM library names, for example, libcollada_dae_d.lib, and replace "lib" with "lib-dbg" in the library path.
+
===Additional configuration options===
*Make sure that your application is using the correct runtime libraries. The "Runtime Library" field in the "Code Generation" tab for the "C/C++" configuration options should be set to "Multi-threaded DLL" if using the release builds of the library or "Multi-threaded Debug DLL" if using the debug builds.
+
*If you are using Visual Studio .NET 2003, sunbstitute "vc7" for "vc8" in the "Additional library directories" field.
 +
*To use the debug version of the libraries:
 +
*# Append "_d" to the end of the COLLADA DOM library names, for example, libcollada_dae_d.lib.
 +
*# Replace "lib" with "lib-dbg" in the library path.
 +
*Make sure that your application is using the correct runtime libraries. The "Runtime Library" field in the "Code Generation" tab for the "C/C++" configuration options should be set to:
 +
** "Multi-threaded DLL" if using the release builds of the library
 +
** "Multi-threaded Debug DLL" if using the debug builds
  
 
==Building the COLLADA DOM==
 
==Building the COLLADA DOM==
Though most developers can use the pre-built libraries, the distribution of the COLLADA DOM includes
+
Though most developers can use the previously built libraries, the distribution of the COLLADA DOM includes
 
full source code and Visual Studio projects for rebuilding the libraries from scratch. Project and solution files for Visual Studio .NET 2003 can be found in
 
full source code and Visual Studio projects for rebuilding the libraries from scratch. Project and solution files for Visual Studio .NET 2003 can be found in
 
  <COLLADA_DOM-directory>/projects/VC++7
 
  <COLLADA_DOM-directory>/projects/VC++7
Line 59: Line 78:
  
 
===External Libraries===
 
===External Libraries===
Building the COLLADA DOM requires that the files for the external libraries it depends be in a specific directory structure. An environment variable, <code>COLLADA_EXTERNAL_LIBS_LOCATION</code>, needs to be set to the directory that contains the following files.
+
Building the COLLADA DOM requires that the files for the external libraries on which it depends be in a specific directory structure. An environment variable, <code>COLLADA_EXTERNAL_LIBS_LOCATION</code>, needs to be set to the directory that contains the following files:
 
  libxml2/win32/include/libxml/* - The libxml2 headers from the distribution
 
  libxml2/win32/include/libxml/* - The libxml2 headers from the distribution
 
  libxml2/win32/include/iconv.h
 
  libxml2/win32/include/iconv.h

Revision as of 19:53, 21 May 2007

This article describes how to set up your software and system to use the COLLADA DOM.

Overview

To use the COLLADA DOM, you must:

  • Download the DOM
  • Download the external libraries that the DOM uses
  • If you are using VisualStudio .NET, set the appropriate configuration values
  • Optionally build the COLLADA DOM (otherwise just use the distributed, already-built binary version)

((EDITOR: This page needs the following improvement: Include a discussion of how to build on Linux. ))


Downloading the COLLADA DOM

The COLLADA DOM is available royalty free and open source for download from SourceForge at http://sourceforge.net/projects/collada-dom.

The COLLADA 1.4.1 DOM 1.3.0 is the latest release package. It comes in three varieties:

  • A source-code-only distribution
  • A binary installer for Visual Studio .NET 2005 (VC8)
  • A binary installer for Visual Studio .NET 2003 (VC7)

The COLLADA DOM is packaged for release only a few times a year. The latest COLLADA DOM code, containing the most recent bug fixes and features, can be downloaded directly from the Subversion repository on SourceForge. To grab the code from Subversion, you'll first need to download and install a Subversion client for your platform from http://subversion.tigris.org/project_packages.html. Then, open a console and run the command:

svn co https://collada-dom.svn.sourceforge.net/svnroot/collada-dom/COLLADA_DOM/trunk collada_dom

That downloads the latest copy of the COLLADA DOM to the directory collada_dom.

External Libraries

The COLLADA DOM and all client applications have three external dependencies, libxml2, zlib, and iconv. The most current Windows binaries for these libraries can be downloaded from http://www.zlatkovic.com/libxml.en.html. For convenience, these libraries are packaged together in the "External Libaries" package available from the COLLADA DOM SourceForge download page.

Building Client Applications

VisualStudio.NET requires additional path and dependency information to properly compile and link applications using the COLLADA DOM.

Setting up include directories

Add the following information to your project:

  • Add the following lines to the “Additional include directories” field in the "General" tab for the "C/C++" project configuration settings:
<COLLADA_DOM-path>\include
<COLLADA_DOM-path>\include\1.4

Linking with the static COLLADA DOM libararies

The COLLADA DOM is provided as both static and dynamic link libraries.

To link with the static COLLADA DOM libraries:

  • Add the following lines to the "Additional library directories" field in the "General" tab for the "Linker" project configuration settings:
<COLLADA_DOM-path>\lib\vc8\1.4
<libxml2, zlib, and iconv lib directory-path> 
  • Add the following lines to the "Additional Dependencies" field in the "Input" tab for the "Linker" project configuration settings:
libcollada_dae.lib
libcollada_dom.lib
libcollada_STLDatabase.lib
libcollada_LIBXMLPlugin.lib
libcollada_stdErrPlugin.lib
libxml2_a.lib
iconv_a.lib
zlib.lib
wsock32.lib

Linking with the dynamic COLLADA DOM library

To link with the dynamic COLLADA DOM library:

  • Add the following line to the "Preprecessor Definitions" field in the "Preprocessor" tab for the "C/C++" project configuration settings:
DOM_DYNAMIC
  • Add the following line to the "Additional library directories" field in the "General" tab for the "Linker" project configuration settings:
<COLLADA_DOM-path>\lib\vc8
  • Add the following line to the "Additional Dependencies" field in the "Input" tab for the "Linker" project configuration settings:
libcollada141dom12.lib

Additional configuration options

  • If you are using Visual Studio .NET 2003, sunbstitute "vc7" for "vc8" in the "Additional library directories" field.
  • To use the debug version of the libraries:
    1. Append "_d" to the end of the COLLADA DOM library names, for example, libcollada_dae_d.lib.
    2. Replace "lib" with "lib-dbg" in the library path.
  • Make sure that your application is using the correct runtime libraries. The "Runtime Library" field in the "Code Generation" tab for the "C/C++" configuration options should be set to:
    • "Multi-threaded DLL" if using the release builds of the library
    • "Multi-threaded Debug DLL" if using the debug builds

Building the COLLADA DOM

Though most developers can use the previously built libraries, the distribution of the COLLADA DOM includes full source code and Visual Studio projects for rebuilding the libraries from scratch. Project and solution files for Visual Studio .NET 2003 can be found in

<COLLADA_DOM-directory>/projects/VC++7

Project and solution files for Visual Studio .NET 2005 can be found in

<COLLADA_DOM-directory>/projects/VC++8

External Libraries

Building the COLLADA DOM requires that the files for the external libraries on which it depends be in a specific directory structure. An environment variable, COLLADA_EXTERNAL_LIBS_LOCATION, needs to be set to the directory that contains the following files:

libxml2/win32/include/libxml/* - The libxml2 headers from the distribution
libxml2/win32/include/iconv.h
libxml2/win32/include/zlib.h
libxml2/win32/lib/iconv_a.lib
libxml2/win32/lib/libxml2_a.lib
libxml2/win32/lib/zlib.lib

Template:DOM tutorial