<?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: Linking .cpp &amp; .c _tasks  using MQX4.0 CW10.3 in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/1456196#M18728</link>
    <description>&lt;P&gt;I have the same &lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/How-to-add-a-cpp-file-into-c-project-in-MCUXpresso-IDE/m-p/1453419#M48659" target="_self"&gt;issue&lt;/A&gt;, but not sure to understand the solution here.&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/57580"&gt;@AMAR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you elaborate what you meant here:&lt;/P&gt;&lt;P&gt;quote:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"What you can do is to have the TASK_TEMPLATE_STRUCT definition .."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to do that?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2022 07:49:36 GMT</pubDate>
    <dc:creator>misterbee</dc:creator>
    <dc:date>2022-05-11T07:49:36Z</dc:date>
    <item>
      <title>Linking .cpp &amp; .c _tasks  using MQX4.0 CW10.3</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/261276#M7785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to add a C++ task into a C project, the example cplus.cpp code. cplus.cpp builds and runs fine on my custom BSP alone. I moved it into my main project and tried to fire off the cplus_task() from inside my C code, like all my other _tasks but the linker complains it cannot find cplus_task().&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if I can do this? &lt;/P&gt;&lt;P&gt;Or is there another way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much for any help or ideas, this may be my last big hurdle (for awhile of course).&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Feb 2013 05:51:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/261276#M7785</guid>
      <dc:creator>cavebiker</dc:creator>
      <dc:date>2013-02-17T05:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Linking .cpp &amp; .c _tasks  using MQX4.0 CW10.3</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/261277#M7786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C++ allows overload function names. We can have a function void dummy(void) as well as void dummy(int)&lt;BR /&gt;with the only difference being the parameters.&lt;/P&gt;&lt;P&gt;Thus, for proper linkage, the linker needs to know which from the two functions it should link.&lt;BR /&gt;The C++ compiler uses name mangling, it adds list of parameters into the function names, for example:&lt;/P&gt;&lt;P&gt; void __dummy_v (void);&lt;BR /&gt; void __dummy_i (int);&lt;/P&gt;&lt;P&gt;If you're in a *.c module and you try to call cplus_task defined in a *.cpp module, then due to C++ name mangling the extern function is not "cplus_task" but something like "__cplus_task_ui" or something like that. You should be able to see the name in disassemble listing of cplus.cpp.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What you can do is to have the TASK_TEMPLATE_STRUCT definition in a *.cpp file and refer to all C tasks via extern "C" {} keyword. That's exactly how you would use MQX API from a C++ source file.&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 07:14:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/261277#M7786</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-02-18T07:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Linking .cpp &amp; .c _tasks  using MQX4.0 CW10.3</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/261278#M7787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it! Name mangling. &lt;/P&gt;&lt;P&gt;Thanks a ton Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 14:44:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/261278#M7787</guid>
      <dc:creator>cavebiker</dc:creator>
      <dc:date>2013-02-18T14:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Linking .cpp &amp; .c _tasks  using MQX4.0 CW10.3</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/1456196#M18728</link>
      <description>&lt;P&gt;I have the same &lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/How-to-add-a-cpp-file-into-c-project-in-MCUXpresso-IDE/m-p/1453419#M48659" target="_self"&gt;issue&lt;/A&gt;, but not sure to understand the solution here.&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/57580"&gt;@AMAR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you elaborate what you meant here:&lt;/P&gt;&lt;P&gt;quote:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"What you can do is to have the TASK_TEMPLATE_STRUCT definition .."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to do that?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 07:49:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linking-cpp-c-tasks-using-MQX4-0-CW10-3/m-p/1456196#M18728</guid>
      <dc:creator>misterbee</dc:creator>
      <dc:date>2022-05-11T07:49:36Z</dc:date>
    </item>
  </channel>
</rss>

