2017-05-31 115 views
1

我想編譯一個C文件滾動蜘蛛。但是我得到了錯誤。雖然我編譯,我得到'命令未找到'錯誤

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'

#!/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' 的代碼

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-gcc'文件。另外,我可以在終端上看到。

> ~/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 

這裏是文件屬性

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 

這是我的電腦

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位之間的差異嗎?

回答

0

您需要用正確的路徑,你要使用的編譯器,以取代線在Makefile

CC=

從您的文章,好像這是

~/Downloads/RollingSpiderEdu-master/MIT_MatlabToolbox/libs/gcc-arm-Toolchain/opt/arm-2012.03/bin/arm-none-linux-gnueabi-gcc

相關問題