[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]Portable.NET update - C compiler
From: |
Rhys Weatherley |
Subject: |
Re: [DotGNU]Portable.NET update - C compiler |
Date: |
Sun, 15 Feb 2004 20:36:33 +1000 |
User-agent: |
KMail/1.4.3 |
On Sunday 15 February 2004 07:48 pm, Mike Aubury wrote:
> Are there any docs for the C compiler bit ?
>
> I'm interested in using it for one of my projects - but I need to be able
> to call external C functions, as well as the standard C ones...
There will be two ways to do this: compile the external code down to IL and
link against it normally. Or import the external routines from a native
library using PInvoke. See the file "pnet/doc/c_users_guide.html" for
further information.
> Also - how does a compiled C program fit into the general .net framework ?
>
> (eg - could I compile a C portion of code and call it from vb.net or
> something)...
The output of the C compiler is IL bytecode inside the global "<Module>" type.
Normally there is no easy way to call methods in this type from other .NET
languages, because Microsoft didn't define a standard way to do it.
Portable.NET's C# compiler has an extension keyword called "__module", which
can assist with calling C functions (see the above documentation file for
information on how to do this). But it is still an open question how we will
do this for other tools. Suggestions are welcome.
Please keep in mind that the C compiler and library are still a work in
progress, so not everything is working just yet.
Cheers,
Rhys.