11 years, 5 months ago.  This question has been closed. Reason: solved

Subdirectories when compiling with GCC arm embedded

Hello all,

I am no compiler guru and would like some assistance for the issue I have.

It builds led blink fine, but when I have dependancies in different directories, the compiler can't find it. For example when I build http://mbed.org/handbook/SDFileSystem it returns:

/media/uploads/daisukeasao/c4ed1b9a0faf1f27a325ad45af792a51.png /media/uploads/daisukeasao/9a3eb7b84e3446aff373819d661c1603.png

I am using GNU tools ARM Embedded 4.7q4 for windows, the target device is a LPC1768. The command I use to compile is the following:

arm-none-eabi-g++ -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections  -DTARGET_LPC1768 -DTOOLCHAIN_GCC_ARM -DNDEBUG -std=gnu++98 -I./mbed -I./mbed/LPC1768 -I./mbed/LPC1768/GCC_ARM  -o main.o main.cpp
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Tmbed/LPC1768/GCC_ARM/LPC1768.ld -L./mbed -L./mbed/LPC1768 -L./mbed/LPC1768/GCC_ARM  -o my_program.elf main.o mbed/LPC1768/GCC_ARM/startup_LPC17xx.o mbed/LPC1768/GCC_ARM/core_cm3.o mbed/LPC1768/GCC_ARM/system_LPC17xx.o mbed/LPC1768/GCC_ARM/cmsis_nvic.o -lmbed -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys 
arm-none-eabi-objcopy -O binary my_program.elf my_program.bin

How do I tell the compiler that it should look in the subdirectory's of the current directory?

Thank you for your time,

Daisuke

1 Answer

d asao
poster
11 years, 5 months ago.

adding "-ldir /pathtomissingfiles" solved the compile issues!