cancel
Showing results for 
Search instead for 
Did you mean: 

Compiler Error During build when i used file concept (fopen and fprintf) to write into file

shekharsulgiti
Associate

Hi All,

Need one help.
When I try write to file using fopen / fwrite functions in debug mode I receive like
Error: L6200E: Symbol __stdout multiply defined (by stdio_streams.o and my_lib.a)

not enough information to list the image map
while building the code. and how I can solve it. 

4 REPLIES 4

@shekharsulgiti wrote:

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


You're using Keil, aren't you?

"multiply defined" is their clumsy way of saying that you have multiple definitions of __stdout

As this is specific to Keil - not really to do with STM32 - you'd be better asking them:

https://community.arm.com/support-forums/f/keil-forum

 

(BTW: it's not a Compiler error - it's a Linker error)

 

EDIT:

The message tells you where  the multiple definitions are:

  1. in stdio_streams.o;
  2. in my_lib.a

So you need to decide which one of them is the one you want, and get rid of the other one.

Presumably, a library with a name like "my_lib" is something you wrote yourself? If so, consider whether it should be defining __stdout ... ?

nouirakh
ST Employee

Hello @shekharsulgiti 

If you need both libraries and they must contain the definition of __stdout, you may need to modify the linker script to resolve the symbol conflict. This can be complex and depends on your specific toolchain and build system.

There's not file system here, are you attempting semi-hosting, or what exactly?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Is this how Keil does UART output from printf?