2014-03-03 08:13 AM
hello everyone, today I see a problem but no way to solve it
I really want your help here is my source code &sharppragma import(__use_no_semihosting_swi) struct __FILE { int handle;}; FILE __stdout; FILE __stdin; ----> errors : symbol __stdout multiply define, symbol __stdin multiply define if I insert the ''extern'' keyword: extern FILE __stdout; extern FILE __stdin; the error will be : Library reports error: __use_no_semihosting_swi was requested, but _sys_open was referenced thank and regards! #semihosting #keil2014-03-03 08:59 AM
Hi
''today I see a problem but no way to solve it I really want your help'' ''here is my source code #pragma import(__use_no_semihosting_swi) struct __FILE { int handle;}; FILE __stdout; FILE __stdin; ----> errors : symbol __stdout multiply define, symbol __stdin multiply define'' There is no way for use to help you unless you tell use more : which compiler/linker which libraries you are using which debugger/IDE your source code that is generating these errors2014-03-03 04:37 PM
dear sung.chen_chung
the tool is Keil uvision4 with ST-Link debugger2014-03-04 01:16 AM
Hi
OK. Do you understand what : ''#pragma import(__use_no_semihosting_swi)'' is trying to do? Do you understand what ''FILE __stdout;'' is trying to do?2014-03-04 07:46 AM
I don't know, can you explain for me
2014-03-04 07:47 AM
Do you have ''Use MicroLIB'' checked?
Otherwise you're going to have to figure where else these definitions are being pulled from. I've got this code in a bunch of my apps and it links just fine. Review the project settings and files more critically.2014-03-04 08:08 AM
Hi
''#pragma import(__use_no_semihosting_swi)'' Is telling the compiler/linker that you as the developer are going to take responsibility for 'semi hosting functionality' - in other words take responsibility for standard IO - the console and error console, serial IO, Disk IO etc This affects things like printf, putc, getc etc See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0067d/Ciheeaja.html ''FILE __stdout;'' Is trying to define where the standard output (console, line out etc) is going. As Clive mentioned, tick the ''Use MicroLIB'' If this does not capture and provide stdout, stdin etc - you cannot use things like printf(). This is embedded development where sometimes there is no provision for stdout and stdin2014-03-04 08:09 AM
thank ad! I have to solved it
2014-03-04 12:47 PM
What is semihosting?
see:http://www.keil.com/support/man/docs/armccref/armccref_Bgbjjgij.htm
And, for using things like printf without Semihosting, see:http://www.keil.com/support/man/docs/ARMLIB/armlib_cjagdcbh.htm
2015-07-03 09:58 PM