You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by charles magnes <ch...@hotmail.com> on 2009/03/27 10:34:07 UTC

I'm encountering problems using 'xerces-c-3.0.1-x86-windows-vc-7.1'

Hello,

 

   I'm encountering problems using 'xerces-c-3.0.1-x86-windows-vc-7.1'. There is a linkage prob.

 

   My purpose is to make a win32 API appli (in c++) able to parse xml files. Then I've download the ''xerces-c-3.0.1-x86-windows-vc-7.1'' lib and installed the path to lib and includes towards this lib.

 

   It seems to be a call to a dll the prob...but I've installed the 2 dll [xerces-c_3_0D.dll + xerces-c_3_0.dll] in many places without results.

 

Thank you for any suggestion.

Claude

 

-----------------------------------------------------------------------

 

CONTEXT: os windows XP, IDE: visual c++ express/DEV c++

 

/////En extract of code/////////////////////>///////////////////////

 

...

//compile AND link ------------------>

 

#include <xercesc/util/PlatformUtils.hpp>

using namespace xercesc;

 

//<-------------------- compile AND link

...

 

//compile BUT don't link ->

 

  try {
    XMLPlatformUtils::Initialize();   // <--- link fails there
  }
  catch (const XMLException& toCatch) {
    // Do your failure processing here
    return 1;
  }

 

//<- compile BUT don't link

 

/////En extract of code///////////////////</////////////////////////

 

ERRORS////////////////////////////////////>/////////////////////////


Édition des liens en cours...
main.obj : error LNK2019: symbole externe non résolu "__declspec(dllimport) public: static void __cdecl xercesc_3_0::XMLPlatformUtils::Initialize(char const * const,char const * const,class xercesc_3_0::PanicHandler * const,class xercesc_3_0::MemoryManager * const)" (__imp_?Initialize@XMLPlatformUtils@xercesc_3_0@@SAXQBD0QAVPanicHandler@2@QAVMemoryManager@2@@Z) référencé dans la fonction "void __cdecl xmlTest(void)" (?xmlTest@@YAXXZ)
main.obj : error LNK2001: symbole externe non résolu "__declspec(dllimport) public: static char const * const xercesc_3_0::XMLUni::fgXercescDefaultLocale" (__imp_?fgXercescDefaultLocale@XMLUni@xercesc_3_0@@2QBDB)
C:\Documents and Settings\claude_antidot\My Documents\Visual Studio 2008\Projects\todotooolIII\Debug\todotooolIII.exe : fatal error LNK1120: 2 externes non résolus


////////////////////////////////////////////</////////////////////////

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx

Re: I'm encountering problems using 'xerces-c-3.0.1-x86-windows-vc-7.1'

Posted by David Bertoni <db...@apache.org>.
charles magnes wrote:
> Hello,
>  
>    I'm encountering problems using 'xerces-c-3.0.1-x86-windows-vc-7.1'. 
> There is a linkage prob.
>  
>    My purpose is to make a win32 API appli (in c++) able to parse xml 
> files. Then I've download the ''xerces-c-3.0.1-x86-windows-vc-7.1'' lib 
> and installed the path to lib and includes towards this lib.
>  
>    It seems to be a call to a dll the prob...but I've installed the 2 
> dll [xerces-c_3_0D.dll + xerces-c_3_0.dll] in many places without results.
>  
> Thank you for any suggestion.
> Claude
>  
> -----------------------------------------------------------------------
>  
> CONTEXT: os windows XP, IDE: visual c++ express/DEV c++
First, you need to download the proper distribution of Xerces-C for your 
version of Visual Studio.  The express editions are either VS 2005 or 
vs2008, not 7.1.

>  
> /////En extract of code/////////////////////>///////////////////////
>  
> ...
> //compile AND link ------------------>
>  
> #include <xercesc/util/PlatformUtils.hpp>
> using namespace xercesc;
>  
> //<-------------------- compile AND link
> ...
>  
> //compile BUT don't link ->
>  
>   try {
>     XMLPlatformUtils::Initialize();   // <--- link fails there
>   }
>   catch (const XMLException& toCatch) {
>     // Do your failure processing here
>     return 1;
>   }
>  
> //<- compile BUT don't link
>  
> /////En extract of code///////////////////</////////////////////////
>  
> ERRORS////////////////////////////////////>/////////////////////////
> 
> Édition des liens en cours...
> main.obj : error LNK2019: symbole externe non résolu 
> "__declspec(dllimport) public: static void __cdecl 
> xercesc_3_0::XMLPlatformUtils::Initialize(char const * const,char const 
> * const,class xercesc_3_0::PanicHandler * const,class 
> xercesc_3_0::MemoryManager * const)" 
> (__imp_?Initialize@XMLPlatformUtils@xercesc_3_0@@SAXQBD0QAVPanicHandler@2@QAVMemoryManager@2@@Z 
> <ma...@Z>) 
> référencé dans la fonction "void __cdecl xmlTest(void)" (?xmlTest@@YAXXZ 
> <ma...@YAXXZ>)
> main.obj : error LNK2001: symbole externe non résolu 
> "__declspec(dllimport) public: static char const * const 
> xercesc_3_0::XMLUni::fgXercescDefaultLocale" 
> (__imp_?fgXercescDefaultLocale@XMLUni@xercesc_3_0@@2QBDB 
> <ma...@2QBDB>)
> C:\Documents and Settings\claude_antidot\My Documents\Visual Studio 
> 2008\Projects\todotooolIII\Debug\todotooolIII.exe : fatal error LNK1120: 
> 2 externes non résolus
You have to add the Xerces-C import library in the Linker options.  Go 
to the properties for your project, click on the arrow next to 
"Configuration Properties," click on the arrow next to "Linker," then 
click on the "General" tab.  In the field caled "Additional Library 
Directories," put in the path to the "lib" directory of the Xerces-C 
distribution.  Then, click on the "Input" tab and add the name of 
appropriate Xerces-C import library.  For more information, you can look 
at any of the samples applications.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org