Am Son, 28 Jan 2001 schrieben Sie:
> Dear mr. Petzold (Hello Olaf),
> On the rtl mailinglist we saw that you have quite some experience in using c++
> in rtlinux. What we would like to know is how to compile our c++ code into a
> kernel module.
> We tried just using g++ and got the following message:
>
> $ indmod module_name.o
> module_name.o: couldn't find the kernel version the module was compiled for
Yep, it seems the g++ does too much optimzing. You will have to compile with
-O0 to get it but that isn't what you want 8)=)
Well, I use a single c file:
----- version.c-----
/** get the kernel version string */
#include <linux/module.h>
#include <linux/version.h>
-----------------
which is simple compiled by gcc and linked. Thank you can turn on all wished
compiler flags. Be aware, don't forget to define __NO_VERSION__ in all other
c/c++ files else you will get more than once the wanted symbol
__module_kernel_version.
What I didn't found yet is where does my symbol __this_module comes from. In
module.h there is only an extern. I was not able to reproduce these symbol.
Normally this is not a problem, maybee some times since some RTL macros refers
to as well.
Hopefully it helps. Avoiding keyname collision and new/delete problems where
solved by this mailing list before. As well as global CTor/DTor. The eh not
yet. The problem is I can not catch exceptions even if I can throw one. The
secret is related to the crtstuff but I was not able to offer it yet
Regards
Olaf
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/