Mr. Erwin some how has a nice sound to it , but the Erwin part would be
more than enough :-)

It doesn't like certain assembler constructs. When you could do is make
a header file with only the prototypes of the functions you need. For
example the 

extern "C" void __set_64bit(long long unsigned int *, unsigned int,
unsigned int);

That header file you can than include in C++ source files. If the
functions (__set_64bit in the example here) is a macro or a static
inline, one can make a C file that has the body of the function. 

You might look on the net for references on how to write kernel modules
in C++ because this is not just an RTL problem. I believe some ppl out
there wrote some help functions in dealing with this.

- Erwin


crzhang wrote:
> 
> Hi,all
> I have proposed this problem to Mr. Erwin, but I think his answer is not good for me.
> Have you met this problem, and how do you solve it?
> The problem is the following:
> I modify the examples/cpp only like the following.
> 
> #include <rtl_cpp.h>
> extern "C" {
> #define new _new
> #include <mbuff.h>
> #undef new
> }
> but when I compile again, and get the followings:
> g++ -D__KERNEL__ -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe 
>-mpreferred-stack-boundary=2 -g -D__RTL__ -DMODULE -D_LOOSE_KERNEL_NAMES 
>-I/usr/src/linux/include -I/usr/src/rtl/include -I/usr/src/rtl/include/compat 
>-I/usr/src/rtl/include/posix    -c -o hello.o hello.cpp
> In file included from /usr/src/linux/include/asm/semaphore.h:31,
>                  from /usr/src/linux/include/linux/fs.h:181,
>                  from /usr/src/rtl/include/mbuff.h:24,
>                  from hello.cpp:5:
> /usr/src/linux/include/asm/system.h: In function `void __set_64bit(long long 
>unsigned int *, unsigned int, unsigned int)':
> /usr/src/linux/include/asm/system.h:153: parse error before `::'
> In file included from /usr/src/linux/include/linux/fs.h:181,
>                  from /usr/src/rtl/include/mbuff.h:24,
>                  from hello.cpp:5:
> /usr/src/linux/include/asm/semaphore.h: In function `void __up_read(rw_semaphore *)':
> /usr/src/linux/include/asm/semaphore.h:323: parse error before `::'
> /usr/src/linux/include/asm/semaphore.h: In function `void __up_write(rw_semaphore 
>*)':
> /usr/src/linux/include/asm/semaphore.h:342: parse error before `::'
> make: *** [hello.o] Error 1
> 
> Thanks a lot!!!
> 
> Wang Heng
> 
> -- [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/
-- [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/

Reply via email to