[Mono-devel-list] Using embedded Mono from Mozilla XPCOM
Jonathan Pryor
jonpryor at vt.edu
Wed Jun 2 20:46:42 EDT 2004
On Wed, 2004-06-02 at 19:03, Boyd Timothy wrote:
<snip/>
> The errors I get start out saying that it can't find "glib.h" and then
> it ends up having loads of "parse errors" while parsing through the Mono
> header files.
I'd guess that you don't have the include directories for GLib in your
compile line. When compiling and linking, you should use the output of
``pkg-config --libs --cflags mono'' in your compile/link line, so that
the appropriate compiler flags are used:
gcc -o my-app my-app.c `pkg-config --cflags --libs mono`
Notice the backticks '`'. This will add all required include paths
(such as /usr/lib/glib-2.0/include) and libraries (-lmono, -lglib-2.0,
etc), permitting both compilation and linking of the final app.
You may encounter other errors dealing with conflicting Win32 symbols,
such as GetSystemInfo(), GetLastError(), CloseHandle(), etc. These
errors are because mono uses a Win32 subset as it's portability layer;
the headers are in $prefix/include/mono/io-layer. If at all possible,
keep these io-layer headers separate from anything that could conflict
with Win32 symbols.
- Jon
More information about the Mono-devel-list
mailing list