[Mono-list] Re: [Mono-devel-list] Building embed sample or cilc generated code on Windows
Bob_Stabler at avid.com
Thu Jun 12 18:39:05 EDT 2003
Now we have it compiling but it won't link, even though libmono.a is in
the lib path:
bobst at BOBST2 /users/bobst/mono/mono/samples/embed
gcc -mno-cygwin -I/users/bobst/mono/mono
users/bobst/mono/install/lib -lmono -lm -lgmodule-2.0 -lglib-2.0 -lintl
-o teste teste.c
ndefined reference to `mono_domain_get'
ndefined reference to `mono_string_new'
ndefined reference to `mono_domain_assembly_open'
ndefined reference to `mono_jit_exec'
undefined reference to `mono_jit_init'
undefined reference to `mono_add_internal_call'
undefined reference to `mono_runtime_exec_managed_code'
undefined reference to `mono_environment_exitcode_get'
undefined reference to `mono_jit_cleanup'
make: *** [all] Error 1
From: Paolo Molaro [mailto:lupus at ximian.com]
Sent: Thursday, June 12, 2003 10:39 AM
To: mono-list at lists.ximian.com; mono-devel-list at 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
> 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:
> gcc -o teste teste.c `pkg-config --cflags --libs mono` -lm
> And the Makefile that cilc generates contains:
> 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
> -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
> >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
> 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
> 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
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 at debian.org debian/rules
lupus at ximian.com Monkeys do it better
Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-devel-list