Re: How to write kernel modules using C++

Paul Flinders (paul@dawa.demon.co.uk)
25 May 1999 21:35:40 +0100


Steve Dodd <dirk@loth.demon.co.uk> writes:

> On Fri, May 21, 1999 at 01:33:13PM +0530, MURALI N wrote:
>
> > I want to know if it is possible to write kernel modules using
> > C++. If yes, then how is it possible. Let me add that I have tried
> > the most trivial modules without any success.
>
> I would have thought it should have been possible. The only thing you'd have to
> do is stop the compiler mangling the init_module() and cleanup_module()
> symbols, and I can't remember how to do that, off hand.

extern "C"

But I doubt the kernel headers compile with a C++ compiler - althought a few
(string.h mainly) have the correct magic to be included in a C++ compile.

Also, lacking C++ runtime support, you probably won't get static class
instances initialised properly

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/