I was able to link Xerces-c staticly, with VC++ 6.0 Although it was a bit
of a hack. First, I changed the VCPPDefs.hpp file to make the
PLATFORM_EXPORT and PLATFORM_IMPORT macros empty if XERCES_STATIC_LIB is
defined:
#ifdef XERCES_STATIC_LIB
#define PLATFORM_EXPORT
#define PLATFORM_IMPORT
#else
#define PLATFORM_EXPORT __declspec(dllexport)
#define PLATFORM_IMPORT __declspec(dllimport)
#endif
Then, I added a custom build step to the end of the build, that executes
the lib utility:
cd $(IntDir)
lib /out:$(OutDir)\xercesD.lib *.obj
Finally, I defined the XERCES_STATIC_LIB macro in the Project Settings.
This does still build the dll( couldn't figure out how to convert the
project to just do the static lib ), and it is unusable, since nothing is
exported. However, since I just throw that away, I didn't care.
I've tested this with the application I wrote using Xerces, and it worked
fine for that. Now, there are a large number of the Xerces-c API's that I
don't use( none of the Namespace specific ones, for example ), so I can't
say if this will work for everyone. However, I would expect that, if I can
get to one function, I should be able to get to them all.
Hope this helps.
Marc Robertson
Staff Consultant
AWD Development
DST Systems, Inc.
"Denny Vrandecic"
<[EMAIL PROTECTED]>
To
12/11/2003 06:16 <[EMAIL PROTECTED]>
AM cc
Subject
Please respond to Re: Static Linking
[EMAIL PROTECTED]
apache.org
Xerce-C is not supposed to work statically. I think it is on the ToDo-List
to create a static version, but there's no promise when this will be
avaiable.
Best regards,
Denny
----- Original Message -----
From: Milan Tomic
To: Xerces-C
Sent: Thursday, December 11, 2003 1:12 PM
Subject: Static Linking
How can I statically link Xerces in my app? I'm using VC++ 6. I've
tried to remove xerces.lib file from Object/library modules list (Project
| Settings... | Linktab) of my project and to add path to Xerces *.obj
files in Tools | Options... | Directories tab. But still I got a lot of
"unresolved external symbol" linker errors.
Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]