<?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>MCUXpresso IDEのトピックRe: Undefined reference in one function; other functions are fine</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1528852#M8435</link>
    <description>&lt;P&gt;Thanks Erich!&amp;nbsp; I was able to determine that the functions were in the library, but the functions were indeed mangled.&amp;nbsp; I ended up revamping the includes and added "extern "C"" to the "#include" statements and I'm moving forward again.&amp;nbsp; Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2022 13:17:05 GMT</pubDate>
    <dc:creator>chadgraham</dc:creator>
    <dc:date>2022-09-27T13:17:05Z</dc:date>
    <item>
      <title>Undefined reference in one function; other functions are fine</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1524439#M8418</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a very large project that consists of numerous libraries and a ThreadX RTOS application.&amp;nbsp; In one of the libraries, I have a C++ class that handles mutexes and I can compile that library without issues.&amp;nbsp; However, when I compile the code application, I get an error "undefined reference to `_txe_mutex_info_get'".&lt;/P&gt;&lt;P&gt;I have double checked the includes, the include paths, the libraries, the library paths, but everything seems correct.&amp;nbsp; (Commenting out the "tx_mutex_info_get()" function call kills the error.)&amp;nbsp; To make it more frustrating, both the library and the application code have been playing nice for over a year and the function call "tx_mutex_info_get()" is used in other functions in the same class without errors.&amp;nbsp; I've walked all of the changes I've made since the last compile, but that too has proven unfruitful.&lt;/P&gt;&lt;P&gt;Does anyone have any suggestions?&lt;/P&gt;&lt;PRE&gt;UINT RtController_Mutexes::_getMutexOwner(&lt;BR /&gt;    TX_MUTEX * mutex,&lt;BR /&gt;    TX_THREAD ** owner)&lt;BR /&gt;{&lt;BR /&gt;  UINT status;&lt;BR /&gt;  std::string msg;&lt;BR /&gt;  CHAR ** name = NULL;&lt;BR /&gt;  ULONG * count = NULL;&lt;BR /&gt;  TX_THREAD ** first_suspended = NULL;&lt;BR /&gt;  ULONG * suspend_count = NULL;&lt;BR /&gt;  TX_MUTEX ** next_mutex = NULL;&lt;BR /&gt;&lt;BR /&gt;  status = tx_mutex_info_get(&lt;BR /&gt;    mutex,&lt;BR /&gt;    name,&lt;BR /&gt;    count,&lt;BR /&gt;    owner,&lt;BR /&gt;    first_suspended,&lt;BR /&gt;    suspend_count,&lt;BR /&gt;    next_mutex);&lt;BR /&gt;&lt;BR /&gt;  // Check for log file controller creation error.&lt;BR /&gt;  if( status != TX_SUCCESS)&lt;BR /&gt;  {&lt;BR /&gt;    // Error stuff&lt;BR /&gt;  } else&lt;BR /&gt;  return( status);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 18:46:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1524439#M8418</guid>
      <dc:creator>chadgraham</dc:creator>
      <dc:date>2022-09-19T18:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference in one function; other functions are fine</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1525462#M8419</link>
      <description>&lt;P&gt;'undefined reference' means that you are calling that method/function/object, but the linker cannot find it.&lt;/P&gt;&lt;P&gt;A few things to check:&lt;/P&gt;&lt;P&gt;- is txe_mutex_info_get called with C or C++ name mangling? It could be that it has been compiled with C++, but you are calling it with C naming? (note: extern "C")&lt;/P&gt;&lt;P&gt;- use the IDE image info: is that object in question present in the binary or not?&lt;/P&gt;&lt;P&gt;- provide a dummy/empty txe_mutex_info_get() in your application, just to make the linker happy. Then check the map file what happend with the one from the OS&lt;/P&gt;&lt;P&gt;- are you using higher level of optimizations? I have seen cases with some 'not so clean code' where the compiler/linker have removed objects, which had lead to such errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 04:10:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1525462#M8419</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2022-09-21T04:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined reference in one function; other functions are fine</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1528852#M8435</link>
      <description>&lt;P&gt;Thanks Erich!&amp;nbsp; I was able to determine that the functions were in the library, but the functions were indeed mangled.&amp;nbsp; I ended up revamping the includes and added "extern "C"" to the "#include" statements and I'm moving forward again.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 13:17:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Undefined-reference-in-one-function-other-functions-are-fine/m-p/1528852#M8435</guid>
      <dc:creator>chadgraham</dc:creator>
      <dc:date>2022-09-27T13:17:05Z</dc:date>
    </item>
  </channel>
</rss>

