<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[直接拷贝官网点灯代码出错error: unknown type name &#x27;&#x5C;U0000200b&#x27; 及解决方案]]></title><description><![CDATA[<p dir="auto">拷贝<a href="https://xr806.docs.aw-ol.com/study/soft_led/" target="_blank" rel="noopener noreferrer nofollow ugc">点灯</a> hb build -f 遇到了如下报错</p>
<pre><code>../../../device/xradio/xr806/ohosdemo/LED/main.c:17:1: error: unknown type name '\U0000200b'
   17 | ​    IoTGpioSetOutputVal(GPIO_ID_PA21, 1);                                      //(5)输出高电平
      |  
../../../device/xradio/xr806/ohosdemo/LED/main.c:8:22: error: expected declaration specifiers or '...' before numeric constant
    8 | #define GPIO_ID_PA21 21
      |                      ^~
../../../device/xradio/xr806/ohosdemo/LED/main.c:17:28: note: in expansion of macro 'GPIO_ID_PA21'
   17 | ​    IoTGpioSetOutputVal(GPIO_ID_PA21, 1);                                      //(5)输出高电平
      |                         ^~~~~~~~~~~~
../../../device/xradio/xr806/ohosdemo/LED/main.c:17:42: error: expected declaration specifiers or '...' before numeric constant
   17 | ​    IoTGpioSetOutputVal(GPIO_ID_PA21, 1);                                      //(5)输出高电平
      |                                       ^
../../../device/xradio/xr806/ohosdemo/LED/main.c:18:1: error: unknown type name '\U0000200b'
   18 | ​    OS_MSleep(500);
      |  
../../../device/xradio/xr806/ohosdemo/LED/main.c:18:18: error: expected declaration specifiers or '...' before numeric constant
   18 | ​    OS_MSleep(500);
      |               ^~~
../../../device/xradio/xr806/ohosdemo/LED/main.c:19:1: error: unknown type name '\U0000200b'
   19 | ​    IoTGpioSetOutputVal(GPIO_ID_PA21, 0);                                      //(6)输出高电平
      |  
../../../device/xradio/xr806/ohosdemo/LED/main.c:8:22: error: expected declaration specifiers or '...' before numeric constant
    8 | #define GPIO_ID_PA21 21
      |                      ^~
../../../device/xradio/xr806/ohosdemo/LED/main.c:19:28: note: in expansion of macro 'GPIO_ID_PA21'
   19 | ​    IoTGpioSetOutputVal(GPIO_ID_PA21, 0);                                      //(6)输出高电平
      |                         ^~~~~~~~~~~~
../../../device/xradio/xr806/ohosdemo/LED/main.c:19:42: error: expected declaration specifiers or '...' before numeric constant
   19 | ​    IoTGpioSetOutputVal(GPIO_ID_PA21, 0);                                      //(6)输出高电平
      |                                       ^
../../../device/xradio/xr806/ohosdemo/LED/main.c:20:1: error: unknown type name '\U0000200b'
   20 | ​    OS_MSleep(500);
      |  
../../../device/xradio/xr806/ohosdemo/LED/main.c:20:18: error: expected declaration specifiers or '...' before numeric constant
   20 | ​    OS_MSleep(500);
      |               ^~~
../../../device/xradio/xr806/ohosdemo/LED/main.c: In function 'LEDMain':
../../../device/xradio/xr806/ohosdemo/LED/main.c:28:1: error: '\U0000200b' undeclared (first use in this function)
   28 | ​        OS_THREAD_PRIO_APP, 4 * 1024) != OS_OK) {
      |  
../../../device/xradio/xr806/ohosdemo/LED/main.c:28:1: note: each undeclared identifier is reported only once for each function it appears in
../../../device/xradio/xr806/ohosdemo/LED/main.c:28:4: error: expected ')' before 'OS_PRIORITY_NORMAL'
   28 | ​        OS_THREAD_PRIO_APP, 4 * 1024) != OS_OK) {
      | ^
      | )
../../../device/xradio/xr806/ohosdemo/LED/main.c:27:7: error: too few arguments to function 'OS_ThreadCreate'
   27 |   if (OS_ThreadCreate(&amp;g_main_thread, "MainThread", MainThread, NULL,
      |       ^~~~~~~~~~~~~~~
In file included from ../../../device/xradio/xr806/xr_skylark/include/kernel/os/os.h:34,
                 from ../../../device/xradio/xr806/ohosdemo/LED/main.c:3:
../../../device/xradio/xr806/xr_skylark/include/kernel/os/os_thread.h:92:11: note: declared here
   92 | OS_Status OS_ThreadCreate(OS_Thread_t *thread, const char *name,
      |           ^~~~~~~~~~~~~~~
../../../device/xradio/xr806/ohosdemo/LED/main.c:29:4: error: expected ';' before 'printf'
   29 | ​    printf("[ERR] Create MainThread Failed\n");
      | ^   ~~~~~~
      | ;
[101/252] gcc cross compiler obj/kernel/liteos_m/kal/posix/src/libposix.time.o
</code></pre>
<p dir="auto">尝试了下把17行前边的字符全删了，重新编译不报错了<br />
如法炮制把其他出错行搞了下，成功编译<br />
感觉是官网代码拷贝的时候混入了奇怪的字符，特发帖提醒下各位(吐槽下)</p>
]]></description><link>https://bbs.aw-ol.com/topic/1167/直接拷贝官网点灯代码出错error-unknown-type-name-u0000200b-及解决方案</link><generator>RSS for Node</generator><lastBuildDate>Mon, 18 May 2026 21:47:15 GMT</lastBuildDate><atom:link href="https://bbs.aw-ol.com/topic/1167.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Mar 2022 13:39:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 直接拷贝官网点灯代码出错error: unknown type name &#x27;&#x5C;U0000200b&#x27; 及解决方案 on Fri, 18 Mar 2022 09:09:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://bbs.aw-ol.com/uid/1029">@pwb555</a> 我试试，谢谢！</p>
]]></description><link>https://bbs.aw-ol.com/post/5157</link><guid isPermaLink="true">https://bbs.aw-ol.com/post/5157</guid><dc:creator><![CDATA[oiouou123]]></dc:creator><pubDate>Fri, 18 Mar 2022 09:09:06 GMT</pubDate></item><item><title><![CDATA[Reply to 直接拷贝官网点灯代码出错error: unknown type name &#x27;&#x5C;U0000200b&#x27; 及解决方案 on Thu, 17 Mar 2022 08:56:39 GMT]]></title><description><![CDATA[<p dir="auto">前几天我也遇到了同样的问题，但我是通过VS code的“将缩进转换为空格”功能解决的。</p>
]]></description><link>https://bbs.aw-ol.com/post/5114</link><guid isPermaLink="true">https://bbs.aw-ol.com/post/5114</guid><dc:creator><![CDATA[PWB555]]></dc:creator><pubDate>Thu, 17 Mar 2022 08:56:39 GMT</pubDate></item></channel></rss>