[Mono-list] Re: [Mono-devel-list] Building embed sample or cilc generated code on Windows

Bob Stabler Bob_Stabler@avid.com
Thu, 12 Jun 2003 17:39:05 -0500


Now we have it compiling but it won't link, even though libmono.a is in
the lib path:

bobst@BOBST2 /users/bobst/mono/mono/samples/embed
$ make
gcc -mno-cygwin -I/users/bobst/mono/mono
-I/users/bobst/mono/install/include/gli
b-2.0 -I/users/bobst/mono/install/lib/glib-2.0/include
-Wl,--export-dynamic -L/
users/bobst/mono/install/lib -lmono -lm -lgmodule-2.0 -lglib-2.0 -lintl
-liconv
-o teste teste.c
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x29):te
ste.c: u
ndefined reference to `mono_domain_get'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x39):te
ste.c: u
ndefined reference to `mono_string_new'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x5f):te
ste.c: u
ndefined reference to `mono_domain_assembly_open'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x9c):te
ste.c: u
ndefined reference to `mono_jit_exec'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x147):t
este.c:
undefined reference to `mono_jit_init'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x15e):t
este.c:
undefined reference to `mono_add_internal_call'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x194):t
este.c:
undefined reference to `mono_runtime_exec_managed_code'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x199):t
este.c:
undefined reference to `mono_environment_exitcode_get'
/cygdrive/c/DOCUME~1/BOBST~1.AVS/LOCALS~1/Temp/ccGsByTX.o(.text+0x1a7):t
este.c:
undefined reference to `mono_jit_cleanup'
make: *** [all] Error 1

-----Original Message-----
From: Paolo Molaro [mailto:lupus@ximian.com]=20
Sent: Thursday, June 12, 2003 10:39 AM
To: mono-list@lists.ximian.com; mono-devel-list@lists.ximian.com
Subject: [Mono-list] Re: [Mono-devel-list] Building embed sample or cilc
generated code on Windows

On 06/10/03 Candace Bain wrote:
> I'm working on a proof of concept application that will need to call
> from a C++ command line application into a C# object running under
mono.
> For performance testing I'll need to run the same app the same way on
> both Linux and Windows.  I've been looking at the embed sample
> application under /mono/samples/embed and the code that the cilc test
> generates under /mcs/tools/cilc/generated, both of these work as
> expected for me when I compile and run them on Linux.  I'm not able to
> compile either of them on Windows.  The instructions for teste.c in
> embed are to run:
>=20
> gcc -o teste teste.c `pkg-config --cflags --libs mono` -lm
>=20
> And the Makefile that cilc generates contains:
>=20
> gcc -Wall -fpic -shared `pkg-config --cflags --libs glib-2.0 mono`
> -lpthread *.c -o libdemo.so

Those instructions are for unixy kind of systems.
I think on windows you'll have to add at least -mno-cygwin to gcc.

> If I run pkg-config --cflags --libs glib-2.0 mono manually it works
and
> returns:
>=20
> -IC:/cygwin/users/candace/install/include
> -I/users/candace/install/include/glib-2.0
> -I/users/candace/install/lib/glib-2.0/include  -Wl,--export-dynamic
> -LC:/cygwin/users/candace/install/lib -L/users/candace/install/lib
> -lmono -lm -lgmodule-2.0 -lglib-2.0 -lintl -liconv
>=20
> >From the errors I'm getting (can't find mono/io-layer/wapi.h, etc) it
> seems clear to me that I need to use some specific header include
paths
> and defines for Windows, but I haven't been able to get a combination
> that works yet.  Does anyone have a Makefile I could use to compile
the
> embed sample or cilc generated test on Windows, or if not does anyone
> have pointers to where I could gather this information?

The only header from io-layer that shuld be installed is io-layer.h:
check you have installed it somewhere.
That header uses=20
#if defined(__WIN32__)
to include the windows headers on windows, instead of wapi.h etc.
So it may be that the compiler doesn't define __WIN32__, seems strange
though. Hope this helps.


lupus

--=20
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list