0

这里面临一个特殊的问题。

我正在尝试在 Raspberry PI 3(使用 xenomai v3.0.3 编译的 Linux Kernel v4.1.21)上编译此代码https://github.com/severinson/VLC-driver但我收到多个编译器错误

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

我能够在 Raspberry PI 上成功编译此代码(Linux Kernel 3.10.25 with xenomai v2.6.3)。我确实遇到了一些缺少头文件的问题,但没有任何问题无法使用 CCFLAGS 进行排序并包括正确的头文件位置。

之前还有一些其他编译器错误(缺少头文件),但我用这个把它们整理出来 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

在 Makefile

但现在我收到编译器错误(见上文)

我希望我已经提供了足够的信息。任何帮助将非常感激

4

1 回答 1

0

rtdm_task_t定义 在 rtdm/rtdm_driver.h

您是否有可能错过了有关找不到“rtdm_driver.h”的错误消息?

我看到有这样的错误消息,你通过修改'修复'??

建议回到原始代码,尤其是在Makefile 弄清楚为什么编译器没有看到所有需要的头文件时的原始代码。

于 2017-05-02T08:14:07.740 回答