<?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>topic Re: MCUXpresso #include Issue in MCUXpresso IDE</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064229#M5745</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a minimum, post the #define that you think is causing the problem and the error message that is being generated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jun 2020 15:08:14 GMT</pubDate>
    <dc:creator>converse</dc:creator>
    <dc:date>2020-06-05T15:08:14Z</dc:date>
    <item>
      <title>MCUXpresso #include Issue</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064227#M5743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a project that appears to have a #include issue that I'd appreciate some help with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a project that includes several libraries.&amp;nbsp; Each of these libraries compiles without issue and my application project will compile until I add a function call into one of the libraries.&amp;nbsp; (Note, I have used functions in other libraries and this library is linked in the same manner.&amp;nbsp; The include directory is added and accessible, the library and library path is properly referenced in the project settings and the file is properly included in the application file.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compile, the error reports that the undefined reference is actually a #define reference in the function I'm calling to to another library file.&amp;nbsp; ( library_a.c #includes library_b.c where the #define is located.)&amp;nbsp; I have confirmed that first library correctly includes the secondary library file and even copying in the #define command into the list library call does not correct the file.&amp;nbsp; (I also don't get a compiler complaint that the definition is #defined in two locations.)&amp;nbsp; I can also call other functions in the first library without issues so I'm pretty certain the includes are properly setup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the user manuals, the NXP forums, and google searches have failed to be helpful.&amp;nbsp; Does anyone have any suggestions on what I can try?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 14:12:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064227#M5743</guid>
      <dc:creator>chadgraham</dc:creator>
      <dc:date>2020-06-05T14:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso #include Issue</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064228#M5744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post/upload a minimal example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 15:01:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064228#M5744</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2020-06-05T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso #include Issue</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064229#M5745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a minimum, post the #define that you think is causing the problem and the error message that is being generated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 15:08:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064229#M5745</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2020-06-05T15:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso #include Issue</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064230#M5746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a bit convoluted, but I'll try to explain it as best I can.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem statement is a call to a defined macro in the library file &lt;EM&gt;ux_host_stack_hcd_thread_entry.c&lt;/EM&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UX_DISABLE_INTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;ux_host_stack_hcd_thread_entry.c&lt;/EM&gt; includes the library header&amp;nbsp;#include "ux_api.h" which includes a basic library file&amp;nbsp;#include "ux_port.h".&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In &lt;EM&gt;ux_port.h&lt;/EM&gt;, the macro is defined:&lt;/P&gt;&lt;P&gt;#define UX_DISABLE_INTS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;old_interrupt_posture =&amp;nbsp; tx_interrupt_control(TX_INT_DISABLE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual error is:&lt;BR /&gt;undefined reference to `tx_thread_interrupt_control'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ux_port.h&lt;/EM&gt;&amp;nbsp; includes&amp;nbsp;&lt;SPAN&gt;the library header&amp;nbsp;#include "ux_api.h" which also includes another library file&amp;nbsp;#include "tx_api.h"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In&amp;nbsp;&lt;EM&gt;tx_api.h&lt;/EM&gt;, tx_thread_interrupt_control is&amp;nbsp;converted to&amp;nbsp;_tx_thread_interrupt_control and declared as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UINT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _tx_thread_interrupt_control(UINT new_posture);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Based on how I interpret the library file, the #define is a macro to a know function in in an included file, but it is unable locate it.&amp;nbsp; I have used the&amp;nbsp;tx_interrupt_control() function in other applications and only referenced the&amp;nbsp;&lt;EM&gt;tx_api.h&lt;/EM&gt; so I am certain that the TX library is functioning.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 16:01:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064230#M5746</guid>
      <dc:creator>chadgraham</dc:creator>
      <dc:date>2020-06-05T16:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso #include Issue</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064231#M5747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A few comments:&lt;/P&gt;&lt;P&gt;- You say the macro is defined as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;old_interrupt_posture =&amp;nbsp; &lt;STRONG&gt;tx_interrupt_control&lt;/STRONG&gt;(TX_INT_DISABLE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt; tx_thread_interrupt_control is&amp;nbsp;converted to&amp;nbsp;_tx_thread_interrupt_control&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but you say the error is&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;undefined reference to `&lt;STRONG&gt;tx_thread_interrupt_control&lt;/STRONG&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So there is something inconsistent in your description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- An undefined reference error is from the linker. So, you are not adding the library that resolves the reference to&amp;nbsp;&lt;STRONG style="color: #51626f; background-color: #ffffff;"&gt;tx_thread_interrupt_control&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Don't get confused between #include (which is a compiler operation) with undefined references which is a linker error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;The evaluation of commands on a &lt;CODE style="background-color: var(--black-075); border: 0px; font-weight: inherit; font-size: 13px; padding: 1px 5px;"&gt;link&lt;/CODE&gt; compile command is very important.&lt;/P&gt;&lt;P style="color: #242729; border: 0px; margin: 0px 0px 1em;"&gt;When the compiler sees .o files, they get added to the target binary automatically, so all .o files are present. That leaves a list of undefined entities which need to be found.&lt;/P&gt;&lt;P style="color: #242729; border: 0px; margin: 0px 0px 1em;"&gt;The next stage is to look through the libraries. Each library is searched, and the .o elements of each library which fulfills an undefined reference is added to the target binary. That always resolves some issues. However, it may also have further requirements. So adding part of a library may add to the required elements to be satisfied.&lt;/P&gt;&lt;P style="color: #242729; border: 0px; margin: 0px 0px 1em;"&gt;When a library requires another library, it needs to be specified after something which required it, and before the libraries which satisfy its requirements.&lt;/P&gt;&lt;P style="color: #242729; border: 0px; margin: 0px 0px 1em;"&gt;There is a chance if the .o files also require the same parts of a library, this issue can crop up when code is deleted from a .o (removing the mechanism which pulls in the library part).&lt;/P&gt;&lt;P style="color: #242729; border: 0px; margin: 0px 0px 1em;"&gt;&lt;/P&gt;&lt;P style="color: #242729; border: 0px; margin: 0px 0px 1em;"&gt;- If this doesn't help, we are going to need to reproduce the problem here to be able to resolve it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jun 2020 09:04:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064231#M5747</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2020-06-07T09:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso #include Issue</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064232#M5748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to solve this specific problem by deleting all of the project references, libraries, library search folders, and include folders.&amp;nbsp; By re-adding the links and references as the compiler progressed through the various errors, I eventually got the entire system to compile.&amp;nbsp; Comparing the before and after include locations and order, I still don't see a difference, but I was able to confirm the functionality of the application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Con Verse and Erich Styger for pointing me in the right direction.&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/converse"&gt;converse&lt;/A&gt;&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/ErichS"&gt;ErichS&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 13:23:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-include-Issue/m-p/1064232#M5748</guid>
      <dc:creator>chadgraham</dc:creator>
      <dc:date>2020-06-09T13:23:45Z</dc:date>
    </item>
  </channel>
</rss>

