1

I am using a STM32F429I Discovery card with a HCSR-04 ultrasonic ranging sensor. I am trying to use the user interface library of Segger (emWin - GUI.lib) in STM32CubeIDE. I want to utilize the GUI.lib file that I have installed from Segger's website in the emWin package. What I am trying to do is to put a needle pointer on the LCD screen of the card for my ranging sensor. I have adjusted the library path and all kinds of necessary stuff, but when I build the program, I get the error (part of it):

error: stray '\225' in program
error: null character(s) ignored
error: stray '\22' in program

And these errors continuously show up. My understanding is that there is a problem with the encoding of the library, so that there are so many null characters being ignored during the build the process. I have tried to use GCC to statically link the library using Windows PowerShell, however, I have failed. What should I do to be able to use the library GUI.lib? I need this library because all of the definitions of the functions declared in the headers reside in it.

Note: I am using Windows 10.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • \225 is out of the ASCII table, you probably try to use Unicode headers in your 8-bit encoded code. – folibis Jul 11 '23 at 11:56
  • @folibis The headers are in UTF-8 encoding (defaulted). What should I change? – ConventionalProgrammer Jul 11 '23 at 12:00
  • I would first check all the places where the error message points to. – folibis Jul 11 '23 at 12:05
  • Re *"I get the error (part of it):"* Can you provide a larger sample, say, 5 times more? – Peter Mortensen Jul 12 '23 at 10:13
  • Null characters in the 'stray' output is often due to 1) either UTF-16 mixed up with UTF-8 (e.g., UTF-16 in the library (e.g., its header files) and UTF-8 in your own source. Or vice versa). – Peter Mortensen Jul 12 '23 at 10:24
  • cont' - 2) Or the (binary) library somehow being included as source by the build system (or the equivalent). Samples: [Sample 1](https://stackoverflow.com/questions/10345802/) and [sample 2](https://stackoverflow.com/questions/28759855/), respectively. [A canonical](https://stackoverflow.com/questions/19198332/compilation-error-stray-302-in-program-etc#comment134248197_19198332). – Peter Mortensen Jul 12 '23 at 10:28
  • Aren't there line numbers in the 'stray' error output? These can provide additional clues. – Peter Mortensen Jul 12 '23 at 10:30

0 Answers0