[Mono-dev] Small issues with the Windows msvc builds, and how I got around them

Jean-Michel.Perraud at csiro.au Jean-Michel.Perraud at csiro.au
Tue Aug 27 23:00:11 UTC 2013


Hi Alex,

Thanks for the information; I sometimes need to dive into the C code to get it to compile under MSVC and your heads up is a time saver. You may want to fork+branch and do a pull request if you think these fixes are not temporary hacks.

profiler-cov is a .vcxproj file, and AFAIK not generated from makefile as the .csproj files are, as you seem to believe. This nevertheless sounds like a good idea.

I’ll work part time on the port of a large C# application to run on Mono+Linux over the coming months; while the target is Linux I think I’ll have the need to build/test on Mono+Windows too and improve the project file generation with MSVS2012. I take due note of your post

Regards,
J-M

From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Alex Forster
Sent: Monday, 26 August 2013 3:11 AM
To: mono-devel-list at lists.ximian.com
Subject: [Mono-dev] Small issues with the Windows msvc builds, and how I got around them

Referring to commit 29c42bf0dc— just a few tips on how I got the -sgen configurations to compile in 32bit release mode with Visual Studio 2012.
 
First issue—
 
msvcrt apparently doesn’t implement _strtoull(). According to this Connect article[1], the functionality exists as _strtoui64().
 
So, as a comment in the Connect article suggested, in eglib\src\glib.h I added this at around line 275 inside of the _MSC_VER ifdef…
 
#define strtoll     _strtoi64
#define strtoull    _strtoui64
 
Second issue—
 
The profiler-cov project links to mono-2.0.lib, but for the -sgen builds, it should be linking to monosgen-2.0.lib. I know the .csproj’s are generated from the makefiles so this isn’t a “real” fix, but all it took for me to get the project to build was to make the project link to the correct library.
 
The x64 build fails miserably because the __asm keyword isn’t supported by Microsoft’s x64 compiler.
 
Alex Forster
 
 
[1] http://connect.microsoft.com/VisualStudio/feedback/details/758053/missing-strtof-strtold-strtoll-strtoull-functions-from-stdlib-h
 


More information about the Mono-devel-list mailing list