[En-Nut-Discussion] Compiler/linker problems using arm-none-eabi-gcc for C and C++ code
harald.kipp at egnite.de
Mon Sep 23 11:59:24 CEST 2013
On 22.09.2013 14:35, Giorgio Kufoalor wrote:
> After some search on the web, and attempts at different suggestions, I have tried editing "CC = $(TRGT)gcc" to "CC= $(TRGT)g++" in Makevars.gcc, and in this way all files (both C and C++) are compiled and linked using "arm-none-eabi-g++". However, this approach rather results in "undefined reference" errors to some C functions.
Your C code probably uses .c as the file extension. What extension are
you using for your C++ sources?
Right now only .cc is detected by the Makefiles as C++ source code.
Which looks quite strange to me, btw. If you got different file
extensions, you need to modify nut/Makerules.gcc. For example, when
using .cpp then add
%.o : %.cpp
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
Note, that indented lines require tabs, spaces won't work.
More information about the En-Nut-Discussion