[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

does mbuff.h work well in your c++ programs in RTLinux



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