/**************************************************************************************
* 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 截取字符串

    vvar='{"floor":2,"hotelid":"3433bbb"}' #vvar='{"hotelid":&qu ...

  2. Qt5.3.2(VS2010)_调试_遇到的问题

    1.(20171124)调试程序 的时候,一直卡住,看到 右下角的进度里面,一直是"Launching Debugger"的状态 ZC: 一直找不到 原因... 尝试了 32位/6 ...

  3. JPA、SpringData JPA 、Hibernate和Mybatis 的区别和联系

    一.JPA 概述 1. Java Persistence API(Java 持久层 API):用于对象持久化的 API 2. 作用:使得应用程序以统一的方式访问持久层 3. 前言中提到了 Hibern ...

  4. js setInterval不能访问外网

    今天调用js setInterval,发现不能访问外网,或者说不能访问本身域名以外的其他域名..不知道什么原因,老是弹出: 网络延时,请稍后再试! setInterval(function(){ va ...

  5. [.NET开发] C#实现的SQL备份与还原功能示例

    本文实例讲述了C#实现的SQL备份与还原功能.分享给大家供大家参考,具体如下: //记得加 folderBrowserDialog1 openFileDialog1 控件 using System.D ...

  6. LeetCode--198--打家劫舍

    问题描述: 你是一个专业的小偷,计划偷窃沿街的房屋.每间房内都藏有一定的现金,影响你偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警. 给 ...

  7. php--------获取当前时间、时间戳

    首先需要知道的是在php中获取时间方法是date(),在php中获取时间戳方法有time().strtotime().下面分别说明. date() 格式为:date($format, $timesta ...

  8. Angular2 -- 生命周期

    组件生命周期钩子 指令和组件的实例有一个生命周期:新建.更新和销毁. 每个接口都有唯一的一个钩子方法,它们的名字是由接口名加上 ng前缀构成的.比如,OnInit接口的钩子方法叫做ngOnInit. ...

  9. 3n+1问题中的几个小的注意点

    3038 3n+1问题  时间限制: 1 s  空间限制: 32000 KB  题目等级 : 白银 Silver 题解       题目描述 Description 3n+1问题是一个简单有趣而又没有 ...

  10. 4.1 delegate

    delegate  ---packed up function public delegate double myDelegate (double x); my delegate d2 = new m ...