Collada DOM using VC9

Hi,

I just tried to build (debug version) my own application using collada dom statically linked library, and during this procedure I experienced a lot of link errors. However, during DOM library build, I had absolutely no problems.

I have follwed the instructions from [i]DOM guide: Setting up - COLLADA Public Wiki
However, it seems that this is not all, or I am doing something terribly wrong???

This is what I got after first tries to build my application:

  1. a series of: MSVCRT.lib(MSVCR90.dll) : error LNK2005: __vsnprintf already defined in libcmtd.lib(vsnprint.obj)

  2. I introduced in Link->Inputs->Ignore Specific Library: msvcrt;msvcprtd; msvcrtd

  3. NowI still have a lot of link errors:

a) zlib.lib(gzio.obj) : warning LNK4049: locally defined symbol __vsnprintf imported

b) libxml2_a.lib(xmlreader.obj) : warning LNK4217: locally defined symbol __vsnprintf imported in function _xmlTextReaderBuildMessage


c) libxml2_a.lib(xmlIO.obj) : error LNK2019: unresolved external symbol __imp___wfopen referenced in function _xmlWrapOpenUtf8


and lot of others…

Can anybody help me with this, please ?

Thanks,
Alex

So you’re using VS 2008 it looks like? Make sure you’re using DOM 2.1 or later. DOM 2.0 had problems with its support for VS 2008.

Let me try building an app that uses the vc9 DOM static lib. I’ll report back with my findings.

It worked fine for me. Are you sure you’re linking against the vc9 versions of the external libs? Some of the external libs (eg libxml) use the same lib for both vc8 and 9, whereas some (eg PCRE) require different libs between vc8 and 9.

This problem is explained in a note in the setting up guide: “In several paths below you’ll see “vc8” used. That’s for Visual C++ 8 (Visual Studio 2005). If you’re using Visual C++ 9 (Visual Studio 2008), substitute “vc9” for “vc8” everywhere.” It’s somewhat easy to overlook that note unfortunately.

Thanks for your efforts!

I just checked. All paths seem to be correct (pointing to VC9). But still the same outcome. I will try to go thru this procedure one more time, to be sure that nothing is missing.

I googled the error message you’re getting and it seems it might be caused by linking against the wrong version of the C runtime. Make sure you’re linking against the “multi-threaded debug DLL” (/MDd) in the debug build and the “multi-threaded DLL” (/MD) in the release build. This setting is available in project properties --> C/C++ --> Code Generation --> Runtime Library.

Since both vc8 and vc9 are set to use the correct runtime by default I didn’t bother mentioning this in the setting up guide, but maybe I should add a note.

Also, the only library you should have in the “ignore specific library” field is msvcrt, and only in the debug build.