gpt4 book ai didi

在树莓派 3 上编译 xenomai v2 代码(使用 xenomai v3 编译的内核 v4.y)

转载 作者:太空宇宙 更新时间:2023-11-04 12:29:21 31 4
gpt4 key购买 nike

这里遇到一个特殊问题。

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

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(带有 xenomai v2.6.3 的 Linux 内核 3.10.25)上成功编译此代码。我确实遇到了一些缺少头文件的问题,但没有任何问题无法使用 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

在生成文件中

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

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

最佳答案

rtdm_task_t 定义在 rtdm/rtdm_driver.h

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

我看到有这样的错误消息,您通过修改 ?? 来“修复”了这些错误消息

建议回到原始代码,尤其是 Makefile 中的原始代码,然后找出为什么编译器没有看到所有需要的头文件。

关于在树莓派 3 上编译 xenomai v2 代码(使用 xenomai v3 编译的内核 v4.y),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43730932/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com