After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666491 - Patch for compile with Visual Studio 2010
Patch for compile with Visual Studio 2010
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.7.8
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-19 09:17 UTC by Thomas Lemm
Modified: 2012-06-07 15:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vc10 project files to compile libxml2 in visual studio ide (116.64 KB, patch)
2011-12-19 09:20 UTC, Thomas Lemm
none Details | Review
patch as before but without all the user files (55.41 KB, patch)
2012-01-05 09:40 UTC, Thomas Lemm
none Details | Review

Description Thomas Lemm 2011-12-19 09:17:27 UTC
Hi,

I have prepared a patch to compile libxml2 on windows within the Visual Studio 2010. This patch adds project files to compile and debug libxml2 using Visual Studio 2010. Only few minor changes have been made to the actual source code.

This patch also requires for the iconv package to be compiled with visual studio 2010 which has been submitted to the iconv project (see: https://savannah.gnu.org/bugs/?35088)

Please don't hesitate to contact me in case of questions or problems. I hope this makes it into a release.

Kind regards

Thomas Lemm
Comment 1 Thomas Lemm 2011-12-19 09:20:40 UTC
Created attachment 203844 [details] [review]
vc10 project files to compile libxml2 in visual studio ide
Comment 2 Fan, Chun-wei 2012-01-03 08:46:46 UTC
Hi Thomas,

Thanks for your patches...

I might not be the best one to review this patchset, but there are some things to note here:

1. It seems to me that this patchset is meant for libiconv rather than libxml2 (libiconv is not a project under GNOME... but anyways you have submitted your patches to the libiconv project, and hope all the best for you there :) ).

2. There is a cscript-based configure.js script in the win32\ sub-folder of libxml2, which is used to create appropriate NMake makefiles where one can use for building on Windows (including Visual Studio 2010)-I have been using that and it seems to work well for me (quite a bit of compiler warnings though), which I believe is still being actively maintained.

3. You might want to try to -not- include the .suo and .user files, as these files are created by Visual Studio 2010 when the .slm/.vcxproj files are opened.

God bless!
Comment 3 Thomas Lemm 2012-01-05 09:38:54 UTC
Chun-wei,

thank you for your comment and suggestions. I have added a new patch which doesn't include the user, suo, ... files. 

This patch (mostly) adds visual studio 2010 project files, to be able to work with libxml2 wihin the Visual Studio 2010 IDE. This is a different and more convenient approach to libxml2 usage, than the nmake approach. I have added the same for the libiconv project, too which can be downloaded via the link above.

So I ask you to try the patch if it is just confirm that the non- vc10 changes I did don't break the other builds.

Kind regards

Thomas Lemm
Comment 4 Thomas Lemm 2012-01-05 09:40:41 UTC
Created attachment 204672 [details] [review]
patch as before but without all the user files
Comment 5 Daniel Veillard 2012-05-09 10:29:38 UTC
Okay, I also removed the change due to the regeneration of 
include/libxml/xmlversion.h
but everything else looks reasonnable. Adding a VC10 subdir under
win32 is a bit heavy, I hope there won't be a new one for each new
version of the Microsoft tools. So commited upstream:

http://git.gnome.org/browse/libxml2/commit/?id=066c69777207436e3517d1b930a97f0e0a8aa060

  thanks !

Daniel
Comment 6 Matt Budd 2012-06-01 19:25:48 UTC
I have just tried to compile libxml2 under Visual Studio 2005, and it seems like your changes for Visual Studio 2010 have broken it.

In wsockcompat.h, you added a guard around the #define EINPROGRESS block...you added a check "#ifndef _MSC_VER". However, for VS2005, _MSC_VER is defined, but these constants are not defined...they were only added in VS2010 and beyond. You can see the details at http://msdn.microsoft.com/en-us/library/5814770t.aspx and then cycle through the different versions in the dropdown on that webpage.

So you have to change the check so it's only for V2010 and after...something like:

"#if (!defined(_MSC_VER) || (_MSC_VER < 1600))"

The value 1600 is for Visual Studio 2010 (1400 is VS2005, 1500 is VS2008).

I don't really know how to supply a patch or anything, but just thought I'd let you guys know.
Comment 7 Daniel Veillard 2012-06-06 03:38:07 UTC
Okay, that makes sense, I commited that change,

http://git.gnome.org/browse/libxml2/commit/?id=8fc913fcc9d2c3fd5c76694cb4e631ca1242de37

thanks Matt !

Daniel
Comment 8 Thomas Lemm 2012-06-07 15:28:42 UTC
Hi,

sorry for breaking - I don't have visual studio 2005 at hand to run countertests.

Kind regards

Thomas