This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

When using option -fno-exceptions, how to fix 'Symbol __stdout multiply defined' ?

Our target is Cortex-M4. We are coding in C++ and compiling with armclang.

We use retarget.c to retarget I/O to a special hardware port (we provide puts() etc). 

retarget.c contains:

struct __FILE { int handle;};
FILE __stdout;
FILE __stdin;

to avoid linking in stdio.o from the C Library.

This all works fine. However, I want to disable exception handling so I added compiler option:

-fno-exceptions

and now I get a linker error:

Error: L6200E: Symbol __stdout multiply defined (by stdio_streams.o and retarget.o).

I've disabled all use of assert (though the error occurs with both release and debug builds). There is no use of cout or printf.

Any ideas why we are seeing this error only with -fno-exceptions active?