首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当我编译时,我得到‘命令找不到’错误

当我编译时,我得到‘命令找不到’错误
EN

Stack Overflow用户
提问于 2017-06-01 04:12:04
回答 0查看 1.1K关注 0票数 1

我正在尝试将一个C文件编译成Rolling Spider。但我弄错了。

代码语言:javascript
复制
Drone: Trying to pack autogenerated code using PackEmbeddedCode...
C-files are being packed...
C-files packed and ready to be built! 
Drone: Autogenerated code using PackEmbeddedCode packed!
Drone: Trying to build code...
/opt/arm-2012.03/bin/arm-none-linux-gnueabi-gcc -c -fPIC -Wall -Werror -o Drone_Compensator.o ../Drone_Compensator.c -lm
make: /opt/arm-2012.03/bin/arm-none-linux-gnueabi-gcc: Command not found
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 127

这里有一个代码'DroneUploadEmbeddedCode.sh‘

代码语言:javascript
复制
#!/bin/bash

# 1. change folder to where this script is
cd `dirname $0`
SCRIPTPATH=$(pwd)

# 1.2 Exit the script if a command fails
set -e

# 2. Pack autogenerated c-code
echo "Drone: Trying to pack autogenerated code using PackEmbeddedCode..."
cd utils/
./PackEmbeddedCode
cd ..
echo "Drone: Autogenerated code using PackEmbeddedCode packed!"

# 3. Build code
echo "Drone: Trying to build code..."
cd ../trunk/embcode/build_arm
make
cd $SCRIPTPATH
echo "Drone: Code built!"

# 4. ftp into the drone and upload the shared library
echo "Drone: Trying to upload shared library..."

echo "> Drone: FTP into the drone"
/usr/bin/expect <<SCRIPT
set timeout -1;
spawn ftp 192.168.1.1;
expect "(192.168.1.1:$USER):";
send "\r";
expect "ftp>";
send "put ../DroneExchange/librsedu.so librsedu.so\r";
expect "ftp>";
send "exit\r";
expect eof
SCRIPT

echo "Drone: Shared library uploaded!"

还有,这是'Makefile‘代码

代码语言:javascript
复制
CC=/opt/arm-2012.03/bin/arm-none-linux-gnueabi-gcc

all:
    $(CC) -c -fPIC -Wall -Werror -o Drone_Compensator.o ../Drone_Compensator.c -lm
    #$(CC) -c -fPIC -Wall -Werror -o Drone_Compensator_capi.o ../Drone_Compensator_capi.c -lm
    $(CC) -c -DDELOS -DDELOS_EDU -fPIC -Wall -Werror -o rsedu_control.o ../rsedu_control.c  -lm
    $(CC) -c -DDELOS -DDELOS_EDU -fPIC -Wall -Werror -o rsedu_vis_helpers.o ../rsedu_vis_helpers.c  -lm
    $(CC) -c -DDELOS -DDELOS_EDU -fPIC -Wall -Werror -o rsedu_vis.o ../rsedu_vis.c  -lm
    $(CC) -c -DDELOS -DDELOS_EDU -fPIC -Wall -Werror -o rsedu_of.o ../rsedu_of.c  -lm
    $(CC) -c -fPIC  -Wall -Werror -o rtGetInf.o ../rtGetInf.c
    $(CC) -c -fPIC  -Wall -Werror -o rtGetNaN.o ../rtGetNaN.c  
    $(CC) -c -fPIC -Wall -Werror -o rt_nonfinite.o ../rt_nonfinite.c
    $(CC) -c -fPIC -Wall -Werror -DDEFAULT_BUFFER_SIZE=4600 -o rt_logging.o ../rt_logging.c 
    #$(CC) -c -fPIC -Wall -Werror -o rt_logging_mmi.o ../rt_logging_mmi.c
    #$(CC) -c -fPIC -Wall -Werror -o rtw_modelmap_utils.o ../rtw_modelmap_utils.c

    #
    $(CC) rsedu_control.o  rsedu_vis_helpers.o rsedu_vis.o rsedu_of.o Drone_Compensator.o rtGetInf.o rtGetNaN.o rt_nonfinite.o rt_logging.o -lm -DDELOS -DDELOS_EDU -fPIC -shared -o ../../../DroneExchange/librsedu.so -I./ 

所以我试着跟踪这些文件。我在正确的文件夹中找到了‘arm-none-linux-gnueabi-gnueabi’文件。另外,我可以在终端上看到。

代码语言:javascript
复制
> ~/Downloads/RollingSpiderEdu-master/MIT_MatlabToolbox/libs/gcc-arm-Toolchain/opt/arm-2012.03/bin$
> ls arm-none-linux-gnueabi-addr2line  arm-none-linux-gnueabi-gdbtui
> arm-none-linux-gnueabi-ar         arm-none-linux-gnueabi-gprof
> arm-none-linux-gnueabi-as         arm-none-linux-gnueabi-ld
> arm-none-linux-gnueabi-c++        arm-none-linux-gnueabi-nm
> arm-none-linux-gnueabi-c++filt    arm-none-linux-gnueabi-objcopy
> arm-none-linux-gnueabi-cpp        arm-none-linux-gnueabi-objdump
> arm-none-linux-gnueabi-elfedit    arm-none-linux-gnueabi-ranlib
> arm-none-linux-gnueabi-g++        arm-none-linux-gnueabi-readelf
> arm-none-linux-gnueabi-gcc        arm-none-linux-gnueabi-size
> arm-none-linux-gnueabi-gcc-4.6.3  arm-none-linux-gnueabi-sprite
> arm-none-linux-gnueabi-gcov       arm-none-linux-gnueabi-strings
> arm-none-linux-gnueabi-gdb        arm-none-linux-gnueabi-strip

以下是文件属性

代码语言:javascript
复制
 file -L arm-none-linux-gnuea
bi-gcc
arm-none-linux-gnueabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, stripped

这是我的电脑

代码语言:javascript
复制
 ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=504637666875a5d526ef51acfe601c99efc99114, stripped

这里的问题是什么?这个问题是不是因为32位和64位之间的差异?

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44293874

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档