Building Collada

来源:互联网 发布:聋哑女孩淘宝模特 编辑:程序博客网 时间:2024/04/29 10:23
文章声明:由于COLLADA以及IDE版本的更新,本文尽量以最新的版本为准,但是不保证一定适用于当前存在的版本,仅就一些编译上遇到的问题给出一些解答,希望能对需要进行COLLADA编程的人员带来一些帮助~



1、Downloading the COLLADA DOM

首先从官网上下载一个最新版本的COLLADA DOM:

https://collada.org/mediawiki/index.php/COLLADA_-_Digital_Asset_and_FX_Exchange_Schema


2、编译:

环境:windows(visio studio 2010)


(1)解决方案路径:

<dom-path>\projects


有时可能单独需要引入daeZAEUncompressHandler.cpp和daeZAEUncompressHandler.h,这两个文件可以分别在<dom-path>\src\dae文件夹以及<dom-path>\include\dae文件夹中找到。
该解决方案中输出目录默认在<dom-path>\build中可以找到。
注意:编译自己的COLLADA工程
你可以在COLLADA的SDK包中找到类似vc8这样的工程文件,这种工程文件时为Visual C++ 8 (Visual Studio 2005).准备的,如果你使用的是Visual C++ 9 (Visual Studio 2008),文件中也会有类似名称的工程文件。
在这个文件夹中你可以回看到某些文件的名称中包含"1.4" 或者"14"之类与COLLADA有关的文件名,如果你使用的是 COLLADA 1.5, 那么就用包含"1.5" 或者"15" 这样文件名的文件代替。.

 

(2)设置 include directories

§  在你的C/C++项目设置中,加入下面几行头文件路径到General标签下的Additional include directories中:
 <dom-path>\include
 <dom-path>\include\1.4

 <dom-path>\external-libs\boost


(3)设置 preprocessor definitions

§ 在C/C++ 工程配置中做以下改动,将下面这几行编码加入到Preprocessor 标签下的Preprocessor Definitionsf配置中:
BOOST_ALL_NO_LIB
PCRE_STATIC

DOM_INCLUDE_LIBXML


(4)用静态链接方式链接COLLADA DOM
§ 把下面这几行加入到Linker ->General->Additional library directories 
<dom-path>\build\vc8-1.4 (release) or <dom-path>\build\vc8-1.4-d (debug)
<dom-path>\external-libs\libxml2\win32\lib
<dom-path>\external-libs\pcre\lib\vc8
<dom-path>\external-libs\minizip\win32\lib\
<dom-path>\external-libs\boost\lib\vc8
§ 把下面这几行加入到Linker ->Input ->Additional Dependencies:
libcollada14dom22-s.lib (release) or libcollada14dom22-sd.lib (debug)
libxml2_a.lib
zlib.lib
wsock32.lib
pcre.lib (release) or pcre-d.lib (debug)
pcrecpp.lib (release) or pcrecpp-d.lib (debug)
minizip.lib (release) or minizip-d.lib (debug)
libboost_filesystem.lib (release) or libboost_filesystem-d.lib (debug)
libboost_system.lib (release) or libboost_system-d.lib (debug)
注:上面设置中pcre-d.lib 和pcrecpp-d.lib在VS2010中需要去掉中间的横杠,即为:pcred.lib 和pcrecppd.lib
Linker warnings/Runtime errors
When you build an application that links against the DOM statically, you might get a Visual Studio warning like this:


LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
If you ignore this warning, you'll then get a runtime failure message that says


This application has failed to start because MSVCR80.dll was not found. ...
If you have this problem, go to theIgnore Specific Library section in the linker settings of your project and add msvcrt. Then relink your project. The link warning should be gone and your application should run fine.


(5)用动态链接库方式链接COLLADA DOM
注意:如果你已经选择了使用静态链接方式链接COLLADA DOM就可以不用这种方式,这两种方式中选择一种就可以了
§ 把下面这几行加入到C/C++ project configuration->Preprocessor->Preprocessor Definitions:
DOM_DYNAMIC
§ 把下面这几行加入到Linker->General->Additional library directories:
<dom-path>\build\vc8-1.4 (release) or <dom-path>\build\vc8-1.4-d (debug)
<dom-path>\external-libs\boost\lib\vc8
§ 把下面这几行加入到Linker->Input ->Additional Dependencies:
libcollada14dom22.lib (release) or libcollada14dom22-d.lib (debug)
libboost_filesystem.lib (release) or libboost_filesystem-d.lib (debug)
libboost_system.lib (release) or libboost_system-d.lib (debug)
原创粉丝点击