[Mono-dev] Compiling Mono Runtime in VS2010

Robert Jordan robertj at gmx.net
Mon Jun 28 06:34:25 EDT 2010


On 28.06.2010 12:22, guysherman wrote:
>
> Hi Robert,
>
> Thanks for that, that helps a little, but I think I still need to free in
> one case, that is mono_string_to_utf16, I need to free the LPTSTR that I get
> back afterwards (the example in test-invoke does). Is this where I would
> call mono_free? Or should I be able to call g_free for this.

mono_free(). g_free() is simply not available because there is
no glib in your case (64-bit VC build).

> I'm somewhat concerned because I can compile eglib for 64-bit, and I can
> compile (and link) libmono for 64-bit (and there are several calls to g_free
> in there), and I can link test-eglib with calls to g_free in there (I added
> one), but I can't link test-invoke, or my own code with calls to g_free in
> there.
>
> Anybody got any ideas as to what I'm missing?

While Mono is internally using g_free, this function is not
exposed via the embedded API. Use mono_free() instead. This
is the new way of disposing memory starting with the
the new (2.0) embedding API.

The embedding samples were not updated to reflect this
change.

Robert



More information about the Mono-devel-list mailing list