The static lib was large( about 7 MB for the release version ). In my case,
the resulting executable( it was actually a DLL ) was about 2 MB, but I
wasn't particularly careful about what Xerces functionality I used.  All I
can say is try it and see what happens.

Marc Robertson
Staff Consultant
AWD Development
DST Systems, Inc.


                                                                           
             "Milan Tomic"                                                 
             <[EMAIL PROTECTED]                                             
             >                                                          To 
                                       <[EMAIL PROTECTED]>       
             12/12/2003 08:27                                           cc 
             AM                                                            
                                                                   Subject 
                                       RE: Static Linking                  
             Please respond to                                             
             [EMAIL PROTECTED]                                             
                apache.org                                                 
                                                                           
                                                                           
                                                                           





    Thank you very much for sharing it with us. I am developing app that
people would download through Internet. It includes Xerces and Xalan
dlls (about 2 MB compressed). My goal is to make app that would have
less then 1 MB in total size (Xerces and Xalan included). So, I'd like
not to use Xerces.dll, but to link its source code into my project. That
way compiler will not include all Xerces *.obj files into my executable
(or dll), but only those I need (use). I have tried to remove Xerces.lib
file from my project and to add paths to Xerces *.obj files in Tools |
Options... | Directories tab, but I didn't had much success. Compiler
couldn't find definitions of Xerces function. Perhaps I need something
similar:

> cd $(IntDir)
> lib /out:$(OutDir)\xercesD.lib *.obj

    As much as I could understand you have produced XercesD.lib file for
staticaly linking into your executable file (or dll). How big is it?


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 12, 2003 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Static Linking
>
>
>
>
>
>
> 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]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to