/**************************************************************************************
* 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. 转载:RESTful API 设计指南

    http://www.ruanyifeng.com/blog/2014/05/restful_api.html 网络应用程序,分为前端和后端两个部分.当前的发展趋势,就是前端设备层出不穷(手机.平板. ...

  2. [原][库][c++]tinyxml使用小结

    参考:http://blog.csdn.net/L_Andy/article/details/40615517 tinyxml官网: http://www.grinninglizard.com/tin ...

  3. Python - openpyxl 读写操作Excel

    openpyxl特点   openpyxl(可读写excel表)专门处理Excel2007及以上版本产生的xlsx文件,xls和xlsx之间转换容易 注意:如果文字编码是“gb2312” 读取后就会显 ...

  4. Java-Java语言

    2017-10-03 21:25:38 Java是一门面向对象编程语言,不仅吸收了C++语言的各种优点,还摒弃了C++里难以理解的多继承.指针等概念,因此Java语言具有功能强大和简单易用两个特征.J ...

  5. java使用freemarker生成静态html页面

    1. 模板文件static.html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " ...

  6. linux编译安装mysql5.1.x

    安装mysql,安装前准备 如果mysql用户不存在,那么添加mysql用户 groupadd mysql useradd -g mysql mysql mysql编译安装 make时间特别长 wge ...

  7. Windows 10 设置 Java 环境变量

    首先你需要在我的电脑中打开,找到环境变量属性. 找到环境变量属性 找到环境变量属性后单击将会看到下面的设置界面. 在这个界面中设置高级系统设置. 环境变量 在弹出的界面中选择设置环境变量. 系统变量 ...

  8. Big Problems for Organizers CodeForces - 418D (贪心,直径)

    大意: 给定n结点树, m个询问, 每次给出两个旅馆的位置, 求树上所有结点到最近旅馆距离的最大值 先考虑一些简单情形. 若旅馆只有一个的话, 显然到旅馆最远的点是直径端点之一 若树为链的话, 显然是 ...

  9. mappingDirectoryLocations

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+kAAAG8CAIAAAAtg3NFAAAgAElEQVR4nO3dO28bTYLv/z4v4MTnPR

  10. javascript数据结构——栈

    栈是一种高效的数据结构,数据只能在栈顶添加或删除,所以这样操作很快,也很容易实现.栈的使用遍布程序语言实现的方方面面,从表达式求值到处理函数调用.接下来,用JavaScript实现一个栈的数据结构. ...