<?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>Kinetis Software Development KitのトピックUsing c plus plus methods in FRDMK22 application</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386852#M1067</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer coding using an object oriented language and have looked for how to use C++ in KSDK and process expert based applications using the Kinetis Design Studio. One generic suggestion I found is to use the C++ compiler for everything but that does not seem possible or at least very straightforward using Eclipse/KDS. Does anyone have suggestions/examples of calling a class method from the KSDK/process expert generated C files? Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Dec 2014 16:27:24 GMT</pubDate>
    <dc:creator>christophertsch</dc:creator>
    <dc:date>2014-12-02T16:27:24Z</dc:date>
    <item>
      <title>Using c plus plus methods in FRDMK22 application</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386852#M1067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer coding using an object oriented language and have looked for how to use C++ in KSDK and process expert based applications using the Kinetis Design Studio. One generic suggestion I found is to use the C++ compiler for everything but that does not seem possible or at least very straightforward using Eclipse/KDS. Does anyone have suggestions/examples of calling a class method from the KSDK/process expert generated C files? Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 16:27:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386852#M1067</guid>
      <dc:creator>christophertsch</dc:creator>
      <dc:date>2014-12-02T16:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using c plus plus methods in FRDMK22 application</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386853#M1068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;KDS uses the GCC compiler. It will easily accept both C++ and C code. We do most of our coding in C++ with some C driver files. We only use the SDK to generate sample code we then recode as C++. So I can't help you with the SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have Main() in a CPP file, this generates the correct initialization for C++. You also need to declare your C functions as extern "C".&amp;nbsp; The names won't then get mangled by the C++ compiler and the linker can correctly find them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 17:00:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386853#M1068</guid>
      <dc:creator>ndavies</dc:creator>
      <dc:date>2014-12-02T17:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using c plus plus methods in FRDMK22 application</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386854#M1069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Norm, thanks for your quick response. It was helpful. I am a bit of a noobie so I am not quite ready to use the SDK for an example to be used in another project. I figured out one way of getting KDS to use G++ for all C files but that really messed things up with the various other C files in the SDK. Then I tried to rename main.c to main.cpp but for some reason the G++ compiler could not find the SDK header files like “cpu.h”.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I can make a “mymain.cpp” that uses the extern “C” construct to make a “mymain” function that can be called from the main in main.c. In Mymain.cpp I can call whatever methods and define whatever class instances I need and still not mess with the code generated by the SDK/process expert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 21:18:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Using-c-plus-plus-methods-in-FRDMK22-application/m-p/386854#M1069</guid>
      <dc:creator>christophertsch</dc:creator>
      <dc:date>2014-12-02T21:18:01Z</dc:date>
    </item>
  </channel>
</rss>

