Install collada-dom library in Ubuntu 10.04, 10.11, 11.04, 11.10 and 12.04

I wanted to install collada-dom to add support for DAE files on OpenSceneGraph. I used the SVN from 2011/03/12 (I already had it downloaded and knew it worked fine). You can download the same code for that date with this commnad:

svn co -r {20110312} https://collada-dom.svn.sourceforge.net/svnroot/collada-dom/trunk collada-dom

The last trunk code in SVN repository fails to compile rt and fx projects and even does not work with OpenSceneGraph (looks like some types disapeared from Collada DOM and OpenSceneGraph plugin for DAE files expects them). Anyway if you want to try you can download running this command:

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

Install the following dependencies for Ubuntu 10.04:

sudo apt-get install libboost1.40-dev libpcre++-dev nvidia-cg-toolkit libboost-filesystem1.40-dev libglut3-dev

For Ubuntu 10.10 and 11.04 install those:

sudo apt-get install libboost1.42-dev libpcre++-dev nvidia-cg-toolkit libboost-filesystem1.42-dev libglut3-dev

And for Ubuntu 11.10 and 12.04 install those:

sudo apt-get install libboost1.46-dev libpcre++-dev nvidia-cg-toolkit libboost-filesystem1.46-dev freeglut3-dev

To compile execute, inside the collada-dom folder, those commands:

make os=linux project=minizip -C dom
make os=linux project=dom -C dom
make os=linux project=rt -C rt
make os=linux project=fx -C fx

We can now just copy the libraries and includes we need to “/usr/local/lib” and “/usr/local/include“:

sudo cp dom/build/linux-1.4/libminizip.* /usr/local/lib/
sudo cp dom/build/linux-1.4/libcollada14dom.* /usr/local/lib/
sudo cp -R dom/include /usr/local/include/colladadom
sudo cp rt/build/linux-1.4/libcollada14rt.* /usr/local/lib/
sudo cp fx/build/linux-1.4/libcollada14fx.* /usr/local/lib/

UPDATE: Fixed the compilation and installation process to bypass the problems with domTest and viewer. Also excluded rt and fx because they are not necessary. Ignore rest of the post.

But there have been some changes in the Boost library used in Ubuntu 12.04: the function native_file_string() has been deleted and we have to change “dom/test/1.4/domTest.cpp” file code on lines 91 and 95 to call c_str() instead of native_file_string(). So change this:

string lookupTestFile(const string& fileName) {
        return (dataPath() / fileName).native_file_string();
}

string getTmpFile(const string& fileName) {
        return (tmpPath() / fileName).native_file_string();
}

To this:

string lookupTestFile(const string& fileName) {
        return (dataPath() / fileName).c_str();
}

string getTmpFile(const string& fileName) {
        return (tmpPath() / fileName).c_str();
}

I got another error while compiling domTest complaining about not being able to locate a reference to libboost_system:

make[1]: Entering directory `/home/user/compilations/collada-dom/dom'
Linking build/linux-1.4/domTest
/usr/bin/ld: build/linux-1.4/obj/domTest.o: undefined reference to symbol 'boost::system::system_category()'
/usr/bin/ld: note: 'boost::system::system_category()' is defined in DSO /usr/lib/libboost_system.so.1.46.1 so try adding it to the linker command line
/usr/lib/libboost_system.so.1.46.1: could not read symbols: Invalid operation

I added -lboost_system -lboost_filesystem to the libOpts variable in “dom/make/common.mk” file (line 25) and it worked.

libOpts := -lboost_system -l boost_filesystem

I also had a similar error while compiling the “viewer” library, but we don’t need this.

You might also like

Installation scripts for ARToolKit, Collada DOM, OpenSceneGraph and osgART
I've created some scripts and patches so installation of all this libraries will be much less painful....
Install OpenSceneGraph 2.9.6 with Collada support in Ubuntu 12.04
Although I usually install OpenSceneGraph 2.8.3 to work with osgART 2.0 RC3 it is also posible to use...
ARSlides v1.0: Augmented Reality slide presentation application
I'm glad to inform that I've (finally) published the code for the Augmented Reality application I've...
Install OpenSceneGraph 2.8.3 with Collada support in Ubuntu 12.04
We are going to install OpenSceneGraph 2.8.3 (for now on OSG) to use it with osgART 2.0 RC3. As far as...
Leave a comment ?

5 Comments.

  1. Thank you, enekochan!

    It was a very hard day before I found your post. Without it I couldn’t build collada-dom during 10 hours.

    Reply
  2. Thank you very much enekochan.

    Reply
  3. I’m glad it helped you both ;) I really had a hard time doing this myself.

    Reply

Leave a Comment