[Mono-devel-list] MSVC port in progress, a couple questions

J Lothian rhalin at gmail.com
Thu Feb 10 22:16:52 EST 2005


Forget all about those errors, got it fixed!  It has something to do
with the SDK and the order that files need to be included in.  For
some reason MS decided not to include all the dependancies, and I had
to include windows.h before the include for wincrypt.h   I do have to
wonder why I didn't have to do this prior to the SDK...

I'll keep everyone posted if I have anymore problems, but hopefully
the next you hear from me while be a working compile!


On Thu, 10 Feb 2005 19:59:32 -0600, J Lothian <rhalin at gmail.com> wrote:
> On Thu, 10 Feb 2005 19:35:44 +0100, Paolo Molaro <lupus at ximian.com> wrote:
> > On 02/10/05 J Lothian wrote:
> > > First, just wanted to let everyone know that I'm working on getting
> > > Mono compiling in MSVC.  I've mainly been working in VC 6, but ran
> >
> > Great!
> >
> > > into a couple conflicts with source that required the updated platform
> > > SDK.  I get undefined errors without the SDK, and problems with some
> > > of the SDK headers when it is included, something to due with defining
> > > the platform your targetting, I believe.  I'll post errors if anyone
> > > thinks they can help with it, but barring that I'll be trying it in
> >
> > Error messages may help or give a clue to people that might know the answer.
> >
> > > To speed up my project creation though, I was wondering if anyone had
> > > a dependancy tree for the libraries, and/or a list of the libraries
> > > themselves.  I've been able to piece together most of it by reading
> > > through makefiles, I just want to make sure I'm not missing anything.
> >
> > You might want to read the toplevel configure.in and the win32 makefile
> > in libgc, too.
> 
> Gotcha, I believe I've got libgc compiling fine, no errors, but have
> yet to test any of it.
> 
> > With automake we use helper libraries, but there is no reason you need to
> > do the same: if you can, you should just build almost all the files into
> > a mono.dll shared lib. Anyway, the helper libs we use are:
> >
> > libgc/libmonogc.la
> > mono/utils/libmonoutils.la
> > mono/os/unix/libmonoos.la // you want the win32 version here
> > mono/os/libmonoos.la
> > mono/metadata/libmetadata.la
> > mono/metadata/libmonoruntime.la
> > mono/mini/libmono.la
> 
> Much much helpful, thanks!
> 
> >
> > You should just skip mint and the arch directory and the other libs that
> > aren't important for a first cut. The libs first on the list are
> > usually pre-reqs for libs further down.
> 
> Yeah, wishing I had skipped some of those non-essentials now, I had
> everything in the metadata directory compiling just fine before I
> installed the MS Platform SDK updates for a problem I had with the
> dissassembler (which compiles with the updates), but now
> mono/metadata/rand.c isn't very happy at all.  Here's an example of
> what happens with the SDK directory being listed first in the include
> path:
> 
> and.c
> c:\program files\microsoft sdk\include\wincrypt.h(37) : error C2061:
> syntax error : identifier 'HRESULT'
> c:\program files\microsoft sdk\include\wincrypt.h(37) : error C2059:
> syntax error : ';'
> c:\program files\microsoft sdk\include\wincrypt.h(249) : error C2061:
> syntax error : identifier 'HCRYPTPROV'
> c:\program files\microsoft sdk\include\wincrypt.h(249) : error C2059:
> syntax error : ';'
> c:\program files\microsoft sdk\include\wincrypt.h(250) : error C2061:
> syntax error : identifier 'HCRYPTKEY'
> c:\program files\microsoft sdk\include\wincrypt.h(250) : error C2059:
> syntax error : ';'
> 
> and so on, there's 102 of them
> 
> to give you an idea what it doesn't like, from wincrypt.h:
> #ifdef __cplusplus
> extern "C" {
> #endif
> 
> #ifndef _HRESULT_DEFINED
> #define _HRESULT_DEFINED
> typedef LONG HRESULT;    //error here!
> 
> #endif // !_HRESULT_DEFINED
> 
> ----------------------------------------
> with the sdk removed from the include path, I now get this:
> 
> rand.c
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(109) : error
> C2065: 'HCRYPTPROV' : undeclared identifier
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(109) : error
> C2146: syntax error : missing ';' before identifier 'provider'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(109) : error
> C2065: 'provider' : undeclared identifier
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(116) : warning
> C4013: 'CryptAcquireContext' undefined; assuming extern returning int
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(118) : error
> C2065: 'PROV_RSA_FULL' : undeclared identifier
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(132) : warning
> C4013: 'memcpy' undefined; assuming extern returning int
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(134) : warning
> C4013: 'CryptGenRandom' undefined; assuming extern returning int
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(136) : warning
> C4013: 'memset' undefined; assuming extern returning int
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(147) : error
> C2146: syntax error : missing ';' before identifier 'provider'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(147) : error
> C2146: syntax error : missing ';' before identifier 'handle'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(148) : error
> C2275: 'guint32' : illegal use of this type as an expression
>        h:\data\developement\vc\monovs\vsdependancies\include\glibconfig.h(42)
> : see declaration of 'guint32'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(148) : error
> C2146: syntax error : missing ';' before identifier 'len'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(148) : error
> C2065: 'len' : undeclared identifier
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(149) : error
> C2275: 'guchar' : illegal use of this type as an expression
>        h:\data\developement\vc\monovs\vsdependancies\include\glib\gtypes.h(47)
> : see declaration of 'guchar'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(149) : error
> C2065: 'buf' : undeclared identifier
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(152) : warning
> C4013: 'CryptReleaseContext' undefined; assuming extern returning int
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(154) : warning
> C4047: '=' : 'int ' differs in levels of indirection from 'void *'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(166) : error
> C2146: syntax error : missing ')' before identifier 'handle'
> H:\Data\Developement\VC\MonoVS\mono\metadata\rand.c(166) : error
> C2059: syntax error : ')'
> Error executing cl.exe.
> 
> rand.obj - 13 error(s), 6 warning(s)
> 
> Keep in mind, this file compiled fine before I installed the platform
> SDK.  I may try to figure out if I can remove it completely, but the
> damage may already be done.
> 
> 
> > At the end of the process there should be only one shared library,
> > mono.dll. All the others are just built only as temporary libs
> > used by the build tools like genmdesc.
> >
> > lupus
> >
> > --
> > -----------------------------------------------------------------
> > lupus at debian.org                                     debian/rules
> > lupus at ximian.com                             Monkeys do it better
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
> 
> One thing I think I should note, that while I can get it compiling
> without error (or at least, I -had- at one point)  There were still a
> good deal of warning messages (maybe a few hundred?), mostly
> signed/unsigned mismatches, I'm assuming this isn't normal on the gcc
> builds?
> 
> I'm trying to see how much of this build I can do without editing
> source, so far, I've only had to change a few minor things here and
> there, I'll make sure they work once I get this thing compiling again,
> I'd rather avoid having to change the code as much as possible to
> limit any trouble it may cause everyone else in the long run.
>



More information about the Mono-devel-list mailing list