[En-Nut-Discussion] Compiler/linker problems using arm-none-eabi-gcc for C and C++ code

Harald Kipp harald.kipp at egnite.de
Mon Sep 23 16:28:39 CEST 2013


Hi Giorgio,

On 23.09.2013 16:06, Giorgio wrote:

> Thanks for your quick response.
> My C code uses .c and C++ uses .cpp. I have therefore tried two options,
> i.e. 
> 1) I modified nut/Makerules.gcc to detect .cpp, as you suggested.
> 2) I changed all the .cpp extensions to .cc.
> Both options still result in the same errors as before.

After fixing

http://sourceforge.net/p/ethernut/code/5344/
http://sourceforge.net/p/ethernut/code/5345/

I'm able to run the C++ demo using the trunk. These fixes are probably
not required in Nut/OS 4.10. After this I'd say that, in general, it
should work.

I can think of several problems, specifically with linker scripts. C++
support had been added by a former contributor many years ago for the
8-bit AVR only. Typically embedded developers try to avoid C++. So this
was no longer maintained over the years. And even the initial support
had been very basic and didn't support all C++ features.

Anyway, let's try to make it work again, following the least-effort
principle. Nowadays C++ is no longer a no-go on embedded devices.

Can you please reduce your sample to a bare minimum, which still shows
the problem? Or start with a new minimalist sample.

Keep Makefile untouched and use .cc as a C++ extension.

When compilation fails, please post the output of the make command, so
we can see the exact error messages of the compiler.

Thanks,

Harald






More information about the En-Nut-Discussion mailing list