<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>compile error unknown type</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56398/compile-error-unknown-type</link><description>When I try to have a struct as an element in another struct I get the following error 
 
 
 
 
 if I use simple data types I don&amp;#39;t get the error</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 11 Jan 2020 00:40:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56398/compile-error-unknown-type" /><item><title>RE: compile error unknown type</title><link>https://devzone.nordicsemi.com/thread/228644?ContentTypeID=1</link><pubDate>Sat, 11 Jan 2020 00:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7ce0bb7-cfdb-4109-ad75-b8034d3a4363</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;My apologies, I made a simple copy paste error. Sorry for the trouble.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compile error unknown type</title><link>https://devzone.nordicsemi.com/thread/228505?ContentTypeID=1</link><pubDate>Fri, 10 Jan 2020 09:12:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70a29d5f-c974-4a54-ba42-e06178e4397d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is because you have not declared&amp;nbsp;&lt;code&gt;a_struct&lt;/code&gt; as a type.&lt;/p&gt;
&lt;p&gt;So you either need to modify it so that it is&amp;nbsp;declared with &lt;code&gt;typedef&lt;/code&gt; like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;typedef struct {
    uint32_t variable1;
    uint32_t variable2;
} a_struct;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;or&lt;/em&gt;, use it like this (with &lt;code&gt;struct&lt;/code&gt;):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;typedef struct {
    struct a_struct var1;
    struct a_struct var2;
} b_struct;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>