You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Andy Heninger <an...@jtcsv.com> on 2000/05/01 22:51:27 UTC

Re: Static Library Build for Win32

I agree that making the project more friendly to those who want static libraries is a good idea.  This is a question/request that keeps coming up.

For MSVC, a place to start might be to add a project configuration to the existing project files, which would make it easy to build a static lib using the IDE.  To do this, choose "Configurations..." from the "Build" menu, select XercesLib, then Add...

The downside of doing this is that the project file would become harder to update - changes to common parts might need to be manually copied into the larger number different configurations.

Here are some notes that were posted here earlier by "Sean Cavanaugh" <se...@dimensionalrift.com>

  As I had to come up with a workaround for my original problem of the new/delete operators, I had to get Xerces to compile as a static library on Win32.  Here are the hoops i had to jump through to get this to work, if anyone is interested :)

  Change the #define's of PLATFORM_EXPORT and PLATFORM_IMPORT in src/util/Compilers/VCPPDefs.hpp to be empty.  I don't think the lib or dll generated for Xerces cares, but the application including these headers will definitely cause the final link to .exe to fail due to looking for exported stuff.

  On the project->properties 'link tab' of XercesLib, for both debug and release, manually add '-lib' to the command line of the link (which causes a backwards compatiblity mode and link calls lib with the same parameters minus the cruft it can't understand)

  On the same pane, rename the output file from Xerces-c-1_1.dll to .lib

  Add user32.lib your my own project, since Xerces isn't linking with it anymore.

  Rebuild xerces and your project both clean
  ----- Original Message ----- 
  From: Bruce MacKinnon 
  To: xerces-dev@xml.apache.org 
  Sent: Saturday, April 29, 2000 11:00 AM
  Subject: Static Library Build for Win32


  Related to the discussion at http://xml-archive.webweaving.org/xml-archive-xerces-c-dev/0090.html, and for other reasons not mentioned, I think it would be useful to make the Xerces source tree a bit more "static library friendly" (on Win32) and also to include a binary release of the static library.  

  Are these things already done?  If not, I'd be happy to provide either/both.  Pls. advise.

  Keep up the good work,

  Bruce MacKinnon
  bruce@mackinnon.com
  New York, NY