1
votes

in my project, i using both Scons and Makefile to build. It working good when i use Makefile ,but got error when i use Scons

"arm-none-eabi-gcc -g -mthumb -mlittle-endian -mcpu=cortex-m4 -mcpu=cortex-m4 -Wl,--start-group -lm -lc -Wl,--end-group -Wl,--gc-sections -Wl,-Map,main.map -Tstm32_flash.ld -Wl,--entry=Reset_Handler -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery -I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Include -I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/ST/STM32F4xx/Include -I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32F4xx_StdPeriph_Driver/inc "-I/home/minhtan/Downloads/led(make file moi)" main.c -c -o main.o
sh: 1: arm-none-eabi-gcc: not found
scons: [main.o] Error 127
scons: building terminated because of errors. "

1
Well, do you have arm-none-eabi-gcc installed?MSalters
Yes, i have arm-none-eabi-gcc installed. version "gcc-arm-none-eabi-5_4-2016q2-20160622-linux" and i add PATH to /etc/profile "export PATH:$PATH=/otc/gcc-arm-none-eabi-5_4-2016q2-20160622-linux/bin" but it errorThomson1608
Can you type arm-none-eabi-gcc at the command line? (to check the PATH is properly set). I mean is /otc correct? Should that be /opt?Galik
oh sory ,in my profile is /optThomson1608
in my Scons have :** # Cross compile setup <br/> cross_prefix = 'arm-none-eabi-' <br/> env.Replace(CC = cross_prefix + 'gcc') <br/> env.Replace(CXX = cross_prefix + 'g++') <br/> env.Replace(LINK = cross_prefix + 'gcc') <br/> env.Replace(AR = cross_prefix + 'ar') <br/> env.Replace(RANLIB = cross_prefix + 'ranlib') <br/> **Thomson1608

1 Answers

1
votes

This looks like the answer to #1 of our "most frequently asked" FAQs at http://scons.org/faq.html could help you out. By default, SCons doesn't import the variables like $PATH from the surrounding shell environment. You have to pull in your $PATH for properly detecting the arm-none-eabi-gcc executable or specify the full path to the executable explicitly...check the mentioned FAQ entry for a more detailed discussion about why things are as they are, and how to provide the required $PATH definitions to your build environments.