Facing a peculiar issue here.
I'm trying to compile this code https://github.com/severinson/VLC-driver on a Raspberry PI 3 ( Linux Kernel v4.1.21 compiled with xenomai v3.0.3 ) but I'm getting multiple compiler errors
make -C /lib/modules/4.1.21-xenomai+/build M=/home/pi/VLC-driver modules
make[1]: Entering directory '/home/pi/linux'
CC [M] /home/pi/VLC-driver/vlc_timer_handler.o
/home/pi/VLC-driver/vlc_timer_handler.c:16:9: error: unknown type name ‘rtdm_task_t’
rtdm_task_t rx_handler_task;
^
/home/pi/VLC-driver/vlc_timer_handler.c:66:1: error: unknown type name ‘rtdm_sem_t’
rtdm_sem_t rx_sem;
^
/home/pi/VLC-driver/vlc_timer_handler.c:67:1: error: unknown type name ‘rtdm_sem_t’
rtdm_sem_t tx_sem;
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘send_bit’:
/home/pi/VLC-driver/vlc_timer_handler.c:82:3: error: implicit declaration of function ‘rtdm_task_sleep_abs’ [-Werror=implicit-function-declaration]
rtdm_task_sleep_abs(tx_sleep_slot, RTDM_TIMERMODE_ABSOLUTE);
^
/home/pi/VLC-driver/vlc_timer_handler.c:82:38: error: ‘RTDM_TIMERMODE_ABSOLUTE’ undeclared (first use in this function)
rtdm_task_sleep_abs(tx_sleep_slot, RTDM_TIMERMODE_ABSOLUTE);
^
/home/pi/VLC-driver/vlc_timer_handler.c:82:38: note: each undeclared identifier is reported only once for each function it appears in
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘get_bit_early_late’:
/home/pi/VLC-driver/vlc_timer_handler.c:117:25: error: ‘RTDM_TIMERMODE_ABSOLUTE’ undeclared (first use in this function)
RTDM_TIMERMODE_ABSOLUTE);
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘get_bit’:
/home/pi/VLC-driver/vlc_timer_handler.c:168:38: error: ‘RTDM_TIMERMODE_ABSOLUTE’ undeclared (first use in this function)
rtdm_task_sleep_abs(rx_sleep_slot, RTDM_TIMERMODE_ABSOLUTE);
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘tx_send_ack’:
/home/pi/VLC-driver/vlc_timer_handler.c:195:5: warning: this decimal constant is unsigned only in ISO C90
send_bit(mask_bit((int) VLC_ACK, i));
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘rx_get_preamble’:
/home/pi/VLC-driver/vlc_timer_handler.c:346:5: warning: this decimal constant is unsigned only in ISO C90
if(rx_packet->current_preamble == (int) VLC_ACK){
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘rx_send_ack’:
/home/pi/VLC-driver/vlc_timer_handler.c:424:5: warning: this decimal constant is unsigned only in ISO C90
if(rx_packet->current_preamble == (int) VLC_ACK){
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘setup_timer_handler’:
/home/pi/VLC-driver/vlc_timer_handler.c:468:3: error: implicit declaration of function ‘rtdm_sem_init’ [-Werror=implicit-function-declaration]
rtdm_sem_init(&tx_sem, 1);
^
/home/pi/VLC-driver/vlc_timer_handler.c:472:3: error: implicit declaration of function ‘rtdm_clock_read_monotonic’ [-Werror=implicit-function-declaration]
rx_sleep_slot = rtdm_clock_read_monotonic();
^
/home/pi/VLC-driver/vlc_timer_handler.c:481:3: error: implicit declaration of function ‘rtdm_task_init’ [-Werror=implicit-function-declaration]
rtdm_task_init(&rx_handler_task, "VLC rx handler", rx_handler,
^
/home/pi/VLC-driver/vlc_timer_handler.c:482:24: error: ‘RTDM_TASK_HIGHEST_PRIORITY’ undeclared (first use in this function)
NULL, RTDM_TASK_HIGHEST_PRIORITY, 0);
^
/home/pi/VLC-driver/vlc_timer_handler.c:492:3: error: implicit declaration of function ‘rtdm_task_destroy’ [-Werror=implicit-function-declaration]
rtdm_task_destroy(&rx_handler_task);
^
/home/pi/VLC-driver/vlc_timer_handler.c: In function ‘cleanup_timer_handler’:
/home/pi/VLC-driver/vlc_timer_handler.c:502:3: error: implicit declaration of function ‘rtdm_sem_destroy’ [-Werror=implicit-function-declaration]
rtdm_sem_destroy(&rx_sem);
^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/pi/VLC-driver/vlc_timer_handler.o' failed
make[2]: *** [/home/pi/VLC-driver/vlc_timer_handler.o] Error 1
Makefile:1384: recipe for target '_module_/home/pi/VLC-driver' failed
make[1]: *** [_module_/home/pi/VLC-driver] Error 2
make[1]: Leaving directory '/home/pi/linux'
Makefile:15: recipe for target 'all' failed
make: *** [all] Error 2
I was able to successfully compile this code on a Raspberry PI ( Linux Kernel 3.10.25 with xenomai v2.6.3 ). I did face some missing header file issues but nothing that could not be sorted using CCFLAGS and including the right header locations.
There were a few other compiler errors ( missing header files ) earlier but i sorted them out using
this
EXTRA_CFLAGS =-I$(KERNEL_SRC)/include/xenomai -I$(KERNEL_SRC)/include/xenomai/native -I/home/pi/xenomai-3.0.3/include/trank -I/usr/include/arm-linux-gnueabihf -I/usr/xenomai/include/cobalt -I/usr/include -I/usr/xenomai/include -L/usr/xenomai/lib -lpthread_rt -lpthread -lrt
in the Makefile
But now i'm receiving the compiler errors ( see above )
I hope I have given enough info regarding this. Any help would be much appreciated
the
rtdm_task_tis defined inrtdm/rtdm_driver.hIs it possible that you missed seeing a error message about 'rtdm_driver.h' not being found?
I see that there were such error messages, which you 'fixed' by modifying ??
suggest going back to the original code, especially the original code in the
Makefilethen figuring out why the compiler is not seeing all the needed header files.