old cat
old cat

Reputation: 73

Error: L6200E: Symbol __stdout multipy defined (by stdio_streams.o and retarget.o), when include stb_image.h

I am using keil to develop my mcu project.
After I include stb_image.h in main.c, I got this error message

.\Objects\JinshenTekDigitalLightingBoard(M433LE8AE).axf: Error: L6200E: Symbol __stdout multiply defined (by stdio_streams.o and retarget.o).

It is my project toolchain info

Toolchain:       MDK Professional 5.36 (Flex)  Version: 5.36.0.0
Toolchain Path:  C:\Keil_v5\ARM\ARMCC_506build750\Bin
C Compiler:      Armcc.exe V5.06 update 6 (build 750)
Assembler:       Armasm.exe V5.06 update 6 (build 750)
Linker/Locator:  ArmLink.exe V5.06 update 6 (build 750)
Library Manager: ArmAr.exe V5.06 update 6 (build 750)
Hex Converter:   FromElf.exe V5.06 update 6 (build 750)
CPU DLL:         SARMCM3.DLL V5.36.0.0
Dialog DLL:      DCM.DLL V1.17.3.0
Target DLL:      NULink\Nu_Link.dll V3.16
Dialog DLL:      TCM.DLL V1.53.0.0

I traced ```retarget.c``` to found that there is a FILE __stdout symbol
/*---------------------------------------------------------------------------------------------------------*/
/* Global variables                                                                                        */
/*---------------------------------------------------------------------------------------------------------*/
#if (defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6040000)) || (defined(__ICCARM__) && (__VER__ >= 8000000))
struct __FILE { int handle; /* Add whatever you need here */ };
#endif
FILE __stdout;
FILE __stdin;

And then I searched keil/arm folder to find another place, defined FILE __stdout symbol

bscheng4176@005-727:/mnt/c/Keil_v5/ARM$ grep -rwn "." -e "FILE __stdin"
./ARMCC/include/stdio.h:138:extern FILE __stdin, __stdout, __stderr;
./ARMCC_506build750/include/stdio.h:138:extern FILE __stdin, __stdout, __stderr;
./ARMCLANG/include/stdio.h:138:extern FILE __stdin, __stdout, __stderr;
./Startup/Retarget.c:25:FILE __stdin;

But it seems that there is no multiple defined of __stdin and __stdout

And my anthor question is, where is the “stdio_streams.o” file, I searched all other place and not found.

Upvotes: 1

Views: 147

Answers (0)

Related Questions