Re: Can't compile CVS comedilib on kernel 2.6.15.7 with RTAI 3.3

On 05/12/06 18:57, Ivan Martinez wrote:
> Hello Ian and others,
> Unfortunatelly your suggestion didn't work, I get the following errors
> when I try to compile my RTAI kernel module "rtmodule.c":
> 
> In file included from /usr/include/sys/ioctl.h:22,
>                 from /usr/local/include/comedilib.h:29,
>                 from /home/ivan/rtai-examples/pi/rtmodule.c:5:
> /usr/include/features.h:265:5: warning: "_FORTIFY_SOURCE" is not defined
> In file included from /usr/include/features.h:308,
>                 from /usr/include/sys/ioctl.h:22,
>                 from /usr/local/include/comedilib.h:29,
>                 from /home/ivan/rtai-examples/pi/rtmodule.c:5:
> /usr/include/sys/cdefs.h:204:1: warning: "__attribute_pure__" redefined
> 
> The fifth line of "rtmodule.c" is where I include comedilib, as you
> can see below:
> 
> #include <linux/module.h>
> #include <linux/kernel.h>
> MODULE_LICENSE("GPL");
> #include "rw_types.h"
> #include <comedilib.h>
> #include <rtai_fifos.h>
> #include <rtai_sched.h>
> #include <rtai_shm.h>
> 
> Any ideas?.

A few things:

1. It shouldn't be including anything from /usr/include.

2. It should be #include <linux/comedilib.h>.

3. It will be easier to build and develop your driver within comedi's 
build environment. See the "Adding new drivers" section in 
"Documentation/comedi/Hardware_Driver.HOWTO".  You will have to modify 
the instructions a little for a realtime driver.  Basically, do 
something similar to the comedi_rt_timer module. But as your module is 
RTAI specific, you may need to add a 'rtai_modules' macro to 
comedi/drivers/Makefile.am, rather than use the existing 'rt_modules' 
macro, append $(rtai_modules) to the 'module_PROGRAMS' macro, and use 
'obj-$(CONFIG_COMEDI_RTAI_MODULES)' in comedi/drivers/Kbuild instead of 
'obj-$(CONFIG_COMEDI_RT_MODULES)'.

-- 
-=( Ian Abbott _at_ MEV Ltd.    E-mail: <abbotti_at_mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

Received on 2006-12-06Z11:24:38