系统相关
首页 > 系统相关> > linux-如何解决此错误—在编译socketcan实用程序时

linux-如何解决此错误—在编译socketcan实用程序时

作者:互联网

我已经从SVN can实用程序下载了.因为默认情况下实用程序可以不在内核中.

svn checkout svn://svn.berlios.de/socketcan/trunk/can-utils

我正在使用的内核是:-

ignite@ignite:~/socketcan/can-utils$uname -a
Linux ignite 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux

然后我重新编译了实用程序.这是找不到isotp.h的错误:—

ignite@ignite:~/socketcan/can-utils$make all
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotprecv.c   -o isotprecv
isotprecv.c:60:29: fatal error: linux/can/isotp.h: No such file or directory
compilation terminated.
make: *** [isotprecv] Error 1
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotpsend.c   -o isotpsend
isotpsend.c:60:29: fatal error: linux/can/isotp.h: No such file or directory
compilation terminated.
make: *** [isotpsend] Error 1
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotpsniffer.c   -o isotpsniffer
isotpsniffer.c:61:29: fatal error: linux/can/isotp.h: No such file or directory
compilation terminated.
make: *** [isotpsniffer] Error 1
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotptun.c   -o isotptun
isotptun.c:69:29: fatal error: linux/can/isotp.h: No such file or directory
compilation terminated.
make: *** [isotptun] Error 1
cc -O2 -Wall -Wno-parentheses -I../kernel/2.6/include -fno-strict-aliasing -DSO_RXQ_OVFL=40 -DPF_CAN=29 -DAF_CAN=PF_CAN    isotpserver.c   -o isotpserver
isotpserver.c:80:29: fatal error: linux/can/isotp.h: No such file or directory
compilation terminated.
make: *** [isotpserver] Error 1
make: Target `all' not remade because of errors.

解决方法:

克隆最新的can-utils存储库:

git clone https://github.com/linux-can/can-utils.git
cd can-utils
./autogen.sh
./configure
make
make install

标签:can-bus,socketcan,linux
来源: https://codeday.me/bug/20191030/1967149.html