/**************************************************************************************
* OK335xS canutils deal with compile error
* 声明:
* 本文主要是记录解决编译can测试工具(canutils)时遇到的一些编译错误。
*
* 2015-9-4 晴 深圳 南山平山村 曾剑锋
*************************************************************************************/ \\\\\\\\\\\\\\\\\\\\\-*- 目录 -*-////////////////////
| 一、参考文章:
| 二、编译后简略的3层文件结构(tree -L ):
| 三、libsocketcan make install 问题:
| 四、canutils 找不到 libsocketcan 问题:
| 五、canutils 安装权限不足:
\\\\\\\\\\\\\\\\\\\\\\\\\\\////////////////////////// 一、参考文章:
. 有谁编译过canutils-4.0.6的吗?
http://bbs.csdn.net/topics/390465516
. AM335X DCAN Driver Guide
http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide#CAN_Utilities
. AM335x DCAN driver compile issues
https://e2e.ti.com/support/embedded/linux/f/354/t/270303 二、最后编译出来简略的3层文件结构(tree -L ):
.
├── canutils-4.0.
│   ├── aclocal.m4
│   ├── AUTHORS
│   ├── autogen.sh
│   ├── ChangeLog
│   ├── config
│   ├── config.log
│   ├── config.status
│   ├── configure
│   ├── configure.ac
│   ├── COPYING
│   ├── GNUmakefile
│   ├── GNUmakefile.am
│   ├── GNUmakefile.in
│   ├── include
│   ├── install
│   │   ├── bin
│   │   ├── lib
│   │   ├── sbin
│   │   └── share
│   ├── libtool
│   ├── man
│   ├── remake.sh
│   └── src
├── canutils-4.0..tar.bz2
├── libsocketcan-0.0.
│   ├── aclocal.m4
│   ├── autogen.sh
│   ├── config
│   ├── config.log
│   ├── config.status
│   ├── configure
│   ├── configure.ac
│   ├── GNUmakefile
│   ├── GNUmakefile.am
│   ├── GNUmakefile.in
│   ├── include
│   ├── install
│   │   ├── include
│   │   ├── lib
│   │   └── share
│   ├── INSTALL
│   ├── libtool
│   ├── README
│   ├── remake.sh
│   ├── src
│   └── tests
└── libsocketcan-0.0..tar.bz2 三、libsocketcan make install 问题:
. 出错现象:
Qt@zengjf:~/practice/c/canTest/libsocketcan-0.0.$ make install
Making install in include
make[]: Entering directory `/home/Qt/practice/c/canTest/libsocketcan-0.0./include'
make[]: Entering directory `/home/Qt/practice/c/canTest/libsocketcan-0.0./include'
make[]: Nothing to be done for `install-exec-am'.
test -z "/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include" || /bin/mkdir -p
"/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include"
/usr/bin/install -c -m libsocketcan.h can_netlink.h
'/home/Qt/practice/c/canTest/libsocketcan-0.0.8/include/.'
/usr/bin/install: `libsocketcan.h' and
`/home/Qt/practice/c/canTest/libsocketcan-0.0./include/./libsocketcan.h' are the same file
/usr/bin/install: `can_netlink.h' and
`/home/Qt/practice/c/canTest/libsocketcan-0.0./include/./can_netlink.h' are the same file
make[]: *** [install-nobase_includeHEADERS] Error
make[]: Leaving directory `/home/Qt/practice/c/canTest/libsocketcan-0.0./include'
make[]: *** [install-am] Error
make[]: Leaving directory `/home/Qt/practice/c/canTest/libsocketcan-0.0./include'
make: *** [install-recursive] Error
. 解决方法:
export GNUEABI=arm-linux-gnueabihf
export CC=$GNUEABI-gcc
export LD=$GNUEABI-ld
export NM=$GNUEABI-nm
export AR=$GNUEABI-ar
export RANLIB=$GNUEABI-ranlib
export CXX=$GNUEABI-c++filt
export INSTALL_PATH=$PWD
export PREFIX=$INSTALL_PATH/
export CROSS_COMPILE_PREFIX=$PREFIX
export PATH=$TOOL_CHAIN_PATH/bin:$PATH #./configure --host=arm-linux --prefix=$PREFIX --enable-debug
# 官网给出的安装目录出错导致的,给出合适的安装路径
./configure --host=arm-arago-linux --prefix=$PREFIX/install --enable-debug 四、canutils 找不到 libsocketcan 问题:
. 错误现象:
checking for pkg-config... /home/Qt/ti-processor-sdk-linux-am335x-evm-01.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/pkg-config
checking pkg-config is at least version 0.9.... yes
checking for libsocketcan... no
configure: error: *** libsocketcan version above 0.0. not found on your system
. 解决方法:
export GNUEABI=arm-linux-gnueabihf
export CC=$GNUEABI-gcc
export LD=$GNUEABI-ld
export NM=$GNUEABI-nm
export AR=$GNUEABI-ar
export RANLIB=$GNUEABI-ranlib
export CXX=$GNUEABI-c++
export PREFIX=$FILESYS_PATH/usr
export CROSS_COMPILE_PREFIX=$PREFIX
export PATH=$TOOL_CHAIN_PATH/bin:$PATH
export LIBSOCKETCAN_INSTALL_DIR=$LIBSOCKETCAN_PATH/install
export PKG_CONFIG_PATH=$LIBSOCKETCAN_PATH/config
export LD_LIBRARY_PATH=${LIBDIR}:${LD_LIBRARY_PATH}
export LD_RAN_PATH=${LIBDIR}:${LD_RAN_PATH}:/home/Qt/practice/c/canTest/libsocketcan-0.0./src/.libs
export LDFLAGS="-Wl,--rpath -Wl,$LIBSOCKETCAN_INSTALL_DIR/lib"
export INCLUDES="-I$LIBSOCKETCAN_INSTALL_DIR/include" #./configure --host=arm-arago-linux --prefix=$PREFIX --enable-debug
# 加上libsocketcan库的位置
./configure --host=arm-linux --prefix=$PREFIX/install --enable-debug libsocketcan_LIBS=-lsocketcan LDFLAGS="-L$PWD/../libsocketcan-0.0.8/install/lib" libsocketcan_CFLAGS=-I$PWD/../libsocketcan-0.0./install/include 五、canutils 安装权限不足:
. 错误现象:
Qt@zengjf:~/practice/c/canTest/canutils-4.0.$ make install
Making install in include
make[]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0./include'
make[]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0./include'
make[]: Nothing to be done for `install-exec-am'.
make[]: Nothing to be done for `install-data-am'.
make[]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0./include'
make[]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0./include'
Making install in config
make[]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0./config'
make[]: Entering directory `/home/Qt/practice/c/canTest/canutils-4.0./config'
make[]: Nothing to be done for `install-exec-am'.
test -z "/usr/install/lib/pkgconfig" || /bin/mkdir -p "/usr/install/lib/pkgconfig"
/bin/mkdir: cannot create directory `/usr/install': Permission denied
make[]: *** [install-pkgconfigDATA] Error
make[]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0./config'
make[]: *** [install-am] Error
make[]: Leaving directory `/home/Qt/practice/c/canTest/canutils-4.0./config'
make: *** [install-recursive] Error
. 解决方法:
export GNUEABI=arm-linux-gnueabihf
export CC=$GNUEABI-gcc
export LD=$GNUEABI-ld
export NM=$GNUEABI-nm
export AR=$GNUEABI-ar
export RANLIB=$GNUEABI-ranlib
export CXX=$GNUEABI-c++
#export PREFIX=$FILESYS_PATH/usr # 换一个有权限的路径
export PREFIX=$PWD
export CROSS_COMPILE_PREFIX=$PREFIX
export PATH=$TOOL_CHAIN_PATH/bin:$PATH
export LIBSOCKETCAN_INSTALL_DIR=$LIBSOCKETCAN_PATH/install
export PKG_CONFIG_PATH=$LIBSOCKETCAN_PATH/config
export LD_LIBRARY_PATH=${LIBDIR}:${LD_LIBRARY_PATH}
export LD_RAN_PATH=${LIBDIR}:${LD_RAN_PATH}:/home/Qt/practice/c/canTest/libsocketcan-0.0./src/.libs
export LDFLAGS="-Wl,--rpath -Wl,$LIBSOCKETCAN_INSTALL_DIR/lib"
export INCLUDES="-I$LIBSOCKETCAN_INSTALL_DIR/include" #./configure --host=arm-arago-linux --prefix=$PREFIX --enable-debug
./configure --host=arm-linux --prefix=$PREFIX/install --enable-debug libsocketcan_LIBS=-lsocketcan LDFLAGS="-L$PWD/../libsocketcan-0.0.8/install/lib" libsocketcan_CFLAGS=-I$PWD/../libsocketcan-0.0./install/include

OK335xS canutils deal with compile error的更多相关文章

  1. VBA Excel WideCharToMultiByte Compile error on 64-bit System

    Compile Error: The code in this project must be updated for use on64-bit systems. Please review and ...

  2. FreeModbus LINUXTCP Compile ERROR

    /********************************************************************************* * FreeModbus LINU ...

  3. Handling CLIK AS3 Compile Error 1152 & 5000

    Handling CLIK AS3 Compile Error 1152 & 5000 Action You add a CLIK AS3 component from CLIK_Compon ...

  4. caffe: compile error : undefined reference to `cv::imread(cv::String const&, int)' et al.

    when I compile caffe file : .build_debug/lib/libcaffe.so: undefined reference to `cv::imread(cv::Str ...

  5. ASIHTTPREQUEST framework compile error when method is called / link error

    never mind!!! duplicate: Error with iOS 5.1 when i use ASIHTTPRequest and SBJSON "I would take ...

  6. caffe: fuck compile error again : error: a value of type "const float *" cannot be used to initialize an entity of type "float *"

    wangxiao@wangxiao-GTX980:~/Downloads/caffe-master$ make -j8find: `wangxiao/bvlc_alexnet/spl': No suc ...

  7. compile error

    stray \241     程序有非法字符,如空格,引号等,一般因为从别的地方粘贴导致这个错误.

  8. caffe: compile error: Could not open or find file your path~~/resized_data/0 and a total of 2 images .

    I0219 14:48:40.965386 31108 net.cpp:76] Memory required for data: 0I0219 14:48:40.965517 31108 layer ...

  9. Visual Studio Code compile error - launch.json must be configured...

    一.在最初使用VS Code创建控制台应用时, 使用VS Code调试工具默认会跑出异常: launch: program 'launch: launch.json must be configure ...

随机推荐

  1. shell 循环总结

    #!/bin/bash my_arry=(a b "c","d" abc) echo "-------FOR循环遍历输出数组--------" ...

  2. c++ 对符合条件的元素进行计数(count_if)

    #include <iostream> // cout #include <algorithm> // count_if #include <vector> // ...

  3. xss脚本注入后端的防护

    1.脚本注入最主要的是不要相信用户输入的任何数据,对数据进行转义 可以使用:org.springframework.web.util.HtmlUtils包中的 HtmlUtils.htmlEscape ...

  4. 《剑指offer》第三十二题(之字形打印二叉树)

    // 面试题32(三):之字形打印二叉树 // 题目:请实现一个函数按照之字形顺序打印二叉树,即第一行按照从左到右的顺 // 序打印,第二层按照从右到左的顺序打印,第三行再按照从左到右的顺序打印, / ...

  5. 雷林鹏分享:C# 索引器(Indexer)

    C# 索引器(Indexer) 索引器(Indexer) 允许一个对象可以像数组一样被索引.当您为类定义一个索引器时,该类的行为就会像一个 虚拟数组(virtual array) 一样.您可以使用数组 ...

  6. Party CodeForces - 906C (状压)

    大意: 给定n(n<=22)个人, m个关系谁跟谁是朋友, 朋友关系是双向的, 每次操作可以选择一个人, 使他的朋友互相成为朋友, 求最少多少次操作可以使所有人互相认识 这个题挺巧妙的了, 关键 ...

  7. poj2686 状压dp入门

    状压dp第一题:很多东西没看懂,慢慢来,状压dp主要运用了位运算,二进制处理 集合{0,1,2,3,....,n-1}的子集可以用下面的方法编码成整数 像这样,一些集合运算就可以用如下的方法来操作: ...

  8. Service Account和其secrets 作用和场景,看了不亏。。

    Service Account概念的引入是基于这样的使用场景: 运行在pod里的进程需要调用Kubernetes API以及非Kubernetes API的其它服务.Service Account它并 ...

  9. Linux 强制安装rpm 包

    Linux 强制安装rpm 包 2014年12月12日 10:21 [root@ilearndb1 Server]# rpm -ivh  unixODBC-devel-2.*  --nodeps -- ...

  10. 流媒体传输协议详解之---RTSP认证

    from:http://blog.csdn.net/machh/article/details/52121648 Rtsp认证主要分为两种:   基本认证(basic authentication)和 ...