/**************************************************************************************
* 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. 《剑指offer》第六题(重要!从尾到头打印链表)

    文件main.cpp // 从尾到头打印链表 // 题目:输入一个链表的头结点,从尾到头反过来打印出每个结点的值. #include <iostream> #include <sta ...

  2. Codeforces 798A - Mike and palindrome

    A. Mike and palindrome time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  3. mysql 将一张表里的数据插入到另一张表

    1. 表结构一样 insert into 表1 select * from 表2 2. 表结构不一样 insert into 表1 (列名1,列名2,列名3) select 列1,列2,列3 from ...

  4. t-SNE 聚类

    一个有效的数据降维的方法 t-SNE,类似PCA的主成分降维分析. 参考: t-分布邻域嵌入算法(t-SNE algorithm)简单理解 t-SNE初学 很好的教程:An illustrated i ...

  5. Phonetics: Lecture Three 语音 第三课 Teacher:Patrick

    元音字母: [u]   put [pʊt]  push [pʊʃ]  full [fʊl]  sugar ['ʃʊgɚ]  cook [kʊk]  look [lʊk]   took [tʊk] (v ...

  6. Windows 10 设置 Java 环境变量

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

  7. Windows 环境下安装 Oracle JDK

    本页面中描述了如何在 Window 环境下安装 Oracle JDK. 我们使用的版本是 Window 10,我们需要安装的版本是 Oracle JDK 8u191. 检查当前版本 在进行新的 JDK ...

  8. poj3080kmp或者暴力

    The Genographic Project is a research partnership between IBM and The National Geographic Society th ...

  9. Visio 入门教程

    最近做一个新项目,目前在需求确立阶段,所以每天任务是写文档讨论再修改.由于是云端架构设计,避免不了图形图表配合文字说明,需要制作 E-R 图.网络图.时序图.UML 类图等,对比其他可视化图表工具,V ...

  10. TitanX服务器登陆网关