<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックProblem with header and source files</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580200#M20183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Patrick_W on Thu Jun 18 00:16:01 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my code is now large enough to split it up in single header and source files. They all got the following format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Header Files:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;

#ifndef&amp;nbsp; __example_h
#define __example_h

#define something

void foo(void);

#endif
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Source Files (example.c):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
#include "example.h"

void foo(void)
{
do something
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The headerfiles are included at the main sourcefile of the project in following order:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
#include "chip.h"
#include "stdlib.h"
#include "stdint.h"

#include "example.h"
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that things that are declared in other headerfiles like variables seem to be unknown in example.h and co.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i get the following error Messages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error: unknown type name 'uint8_t'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;error: 'LPC_SPI' undeclared (first use in this function)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Headerfiles are all imported into the inc folder and the source files i added to the src folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the project properties i checked: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C/C++ Build/Settings/Tool Settings/Includes&amp;nbsp;&amp;nbsp; if the specific inc folder is there. Looks correct for me see attached picture&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think i got something wrong with my project properties. May somebody got an advice how to solve this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:18:14 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:18:14Z</dc:date>
    <item>
      <title>Problem with header and source files</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580200#M20183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Patrick_W on Thu Jun 18 00:16:01 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my code is now large enough to split it up in single header and source files. They all got the following format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Header Files:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;

#ifndef&amp;nbsp; __example_h
#define __example_h

#define something

void foo(void);

#endif
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Source Files (example.c):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
#include "example.h"

void foo(void)
{
do something
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The headerfiles are included at the main sourcefile of the project in following order:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;
#include "chip.h"
#include "stdlib.h"
#include "stdint.h"

#include "example.h"
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that things that are declared in other headerfiles like variables seem to be unknown in example.h and co.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i get the following error Messages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error: unknown type name 'uint8_t'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;error: 'LPC_SPI' undeclared (first use in this function)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Headerfiles are all imported into the inc folder and the source files i added to the src folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the project properties i checked: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C/C++ Build/Settings/Tool Settings/Includes&amp;nbsp;&amp;nbsp; if the specific inc folder is there. Looks correct for me see attached picture&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think i got something wrong with my project properties. May somebody got an advice how to solve this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:18:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580200#M20183</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with header and source files</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580201#M20184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Thu Jun 18 01:02:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Include stdint.h in your header file :O &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or, if you use LPCOpen, board.h or chip.h...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:18:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580201#M20184</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with header and source files</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580202#M20185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Patrick_W on Thu Jun 18 02:55:28 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey R2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is this they only possibility to solve this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Because it doesn't seem very handsome to include allways the same headerfiles in other headerfiles&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:18:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580202#M20185</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with header and source files</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580203#M20186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Thu Jun 18 03:46:59 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;is this they only possibility to solve this problem.&lt;BR /&gt;Because it doesn't seem very handsome to include allways the same headerfiles in other headerfiles&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you serious? Of course that is what you have to do. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If a header file is dependent on something defined in another header file, it should ALWAYS reference it. Otherwise, somebody using the header file will have to dig around finding all of the headers files they need to include. Take a look a standard C header files to see what I mean.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:18:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-header-and-source-files/m-p/580203#M20186</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:18:16Z</dc:date>
    </item>
  </channel>
</rss>

