Expat 2.0.1 for 64-bit Windows

I couldn’t find any instructions for building Expat for 64-bit Windows (x64), so I updated the 32-bit projects files myself: expat-vs2008-x64.zip. See my projects page for brief usage instructions.

Update: With the March 2012 release of Expat 2.1.0, Expat now supports building with CMake, and these build files are no longer necessary. After installing CMake and downloading and extracting the Expat tarball, just do the following to build solution and project files for Visual Studio 11 (aka 2012) Win64 from the Developer Command Prompt for VS2012:

C:\dev\expat-2.1.0>md build

C:\dev\expat-2.1.0>cd build

C:\dev\expat-2.1.0\build>cmake .. -G "Visual Studio 11 Win64"
-- The C compiler identification is MSVC 17.0.50727.1
-- The CXX compiler identification is MSVC 17.0.50727.1
-- Check for working C compiler using: Visual Studio 11 Win64
-- Check for working C compiler using: Visual Studio 11 Win64 -- works
...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/expat-2.1.0/build

C:\dev\expat-2.1.0\build>msbuild expat.sln /p:Configuration=Release
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.17929]
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2/20/2013 10:42:23 AM.
Project "C:\dev\expat-2.1.0\build\expat.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|x64".
...
66 Warning(s)
0 Error(s)

Time Elapsed 00:00:03.38

expat.dll will be in the Release directory. CMake supports generating project files for versions as old as Visual Studio 6, so this approach completely replaces the need for building project files by hand.

7 Comments

  1. Tried above steps and libexpat got generated… my requirement is to have the xmlparse and xmltok libraries….which doesn’t get generated with above specified steps.
    Any suggestion in this regard is helpful.

  2. I am getting an error:
    “expat.sln(1): Solution file error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 9.0, inclusive.”

    I have downloaded expat 2.1.0 and followed the above mentioned steps after converting the project to VS2008 solution.

  3. Sorry, I’m not familiar with that DLL. It’s not part of my build. The only DLL I have is expat.dll, along with some test executables. The tests run fine for me:

    C:\dev\expat-2.1.0\build\Release>runtests.exe
    Expat version: expat_2.1.0
    100%: Checks: 50, Failed: 0

  4. Thanks for the update. After posting my comment i located the code and header files online and re-built the project and compiled successfully.

    However, my error of ‘is not a valid Win32 application’ is still valid for the lxp.dll. Do you have any pointers on where i can get hold of or the source so i can build my own 64 bit version of this particular dll?

    Many thanks for a fast response yesterday 🙂

  5. When i unzip the download contents and open up in either VS 2010 or VS 2012 i cannot build/batch build because theres no file contents. I get the error “Error 1 error C1083: Cannot open source file: ‘xmlparse.c’: No such file or directory C:\Users\\AppData\Local\Temp\Temp1_expat-vs2008-x64(1).zip\lib\c1 expat”

    Can i have some assistance please?

Leave a Reply to tkms Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.