COLLADA or FCOLLADA and MFC

Hello.

I´m trying to do a collada loader using VS2003 (like FCOLLADA) and MFC and OpengGL.

But when I try to use FCOLLADA with a MFC project (SDI or MDI) I get a lot linker errors.

Does anyone know how I should configure my MFC project?

I think maybe it is related about “Runtime Library Multi-threaded Debug (/MTd)”

Thank you very much for your help.

Bye.

Hello everybody.

I recompiled source code using MTD, like my app, and now I get new errors.

It will be defines conflics, but I cannot solve it. :frowning:

After configure my project and:

add this lines at the end of stdafx.h
#define UNICODE
#define _UNICODE
#define NO_LIBXML
#include “FCollada.h”

and add to my project

#include “FCDocument\FCDocument.h”

FCDocument* document = FCollada::NewTopDocument();

I get this errors:

c:\FCollada_Source_113\FUtils\FUString.h(58) : error C2084: function ‘bool IsEquivalent(const char *,const char *)’ already has a body
c:\FCollada_Source_113\FUtils\FUString.h(25) : see previous definition of ‘IsEquivalent’
c:\FCollada_Source_113\FUtils\FUString.h(59) : error C2084: function ‘bool IsEquivalent(const string &,const char *)’ already has a body
c:\FCollada_Source_113\FUtils\FUString.h(26) : see previous definition of ‘IsEquivalent’
c:\FCollada_Source_113\FUtils\FUString.h(60) : error C2084: function ‘bool IsEquivalent(const char *,const string &)’ already has a body
c:\FCollada_Source_113\FUtils\FUString.h(27) : see previous definition of ‘IsEquivalent’

By the way, if I don´t use UNICODE define, I get this:

Loader error LNK2005: “void __cdecl operator delete(void *,int,char const *,int)” (??3@YAXPAXHPBDH@Z) already defined in FColladaSD.lib(FCollada.obj)

Loader error LNK2005: “void __cdecl operator delete[](void *,int,char const *,int)” (??_V@YAXPAXHPBDH@Z) already defined in FColladaSD.lib(FCDEffectStandard.obj)

Loader fatal error LNK1169: one or more multiply defined symbols found

Any idea?

Thank you for your help.

Bye bye.

You should define UNICODE in project settings or before including any windows stuff.

In your case ‘TCHAR’ is ‘char’ (cause defined UNICODE after windows headers), thus ‘fchar’ is ‘char’ too and ‘fstring’ becomes std::basic_string<char>, which is equivalent to std::string. Hence function redefinition errors you’ve got.

HTH

I solved it.

Thanks!!!