<?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>MQX Software SolutionsのトピックRe: MQX C++ project in CodeWarrior</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307532#M9863</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;HI N&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;eerav,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Below you can find what worked for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; 1) &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Add the following macros in &lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\config\&amp;lt;board&amp;gt;\user_config.h&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt; &lt;SPAN style="color: black;"&gt;MQX_SUPPRESS_FILE_DEF&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt; &lt;SPAN style="color: black;"&gt;BSPCFG_ENABLE_CPP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt; &lt;SPAN style="color: black;"&gt;MQX_SUPPRESS_STDIO_MACROS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #1f497d;"&gt;MQX_SUPRESS_FILE_DEF&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt; disables definition of FILE. EWL has its own FILE with different meaning, thus, EWL should link with EWL’s FILE, MQX should link with MQX_FILE, but the linking order is only one – you either take FILE from MQX or from EWL. Therefore we disable, with this macro, MQX to define FILE. Then MQX has to use MQX_FILE and EWL can continue using EWL FILE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #1f497d;"&gt;BSPCFG_ENABLE_CPP&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt; enables EWL functions required when using c++. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #1f497d;"&gt;MQX_SUPRESS_STDIO_MACROS&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; Similar as MQX_SUPRESS_FILE_DEF, stdio macros are different files (MQX_FILE) than EWL definitions, different pointer in memory and different structure members. Then, MQX must use its own definitions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;2) &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Now, stdin, stdout and stderr definitions must be redefined. To do this there are 2 options.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 67px;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;A)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;The correct way would be to add the following macros in &lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\mqx\source\include\fio.h. &lt;/EM&gt;&lt;/STRONG&gt;Recompile BSP and PSP (&lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\mqx\build\cw10gcc\bsp_&amp;lt;board&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\mqx\build\cw10gcc\psp_&amp;lt;board&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt;). Errors will appear, go to each of them and replace &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdin&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; for &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;_mqxio_stdin&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; and &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdout&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; for &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;_mqxio_stdout. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Recompile again, no errors should appear this time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt; _mqxio_stdin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (MQX_FILE_PTR)_io_get_handle(IO_STDIN)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt; _mqxio_stdout&amp;nbsp;&amp;nbsp;&amp;nbsp; (MQX_FILE_PTR)_io_get_handle(IO_STDOUT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt; _mqxio_stderr&amp;nbsp;&amp;nbsp;&amp;nbsp; (MQX_FILE_PTR)_io_get_handle(IO_STDERR)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 90px;"&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 67px;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;B)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;A work around would be to force the project to use &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdin&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdout&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; and &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stderr &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;by taking these defines out of the #if directive. With the default build settings the linker will use the MQX definitions, the side effect is that after recompiling BSP and PSP warnings will appear alerting that these macros are redefined.&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;&lt;SPAN class="pasted-list-info"&gt;1)&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pasted-list-info"&gt;&lt;/SPAN&gt;3) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Now you can create a new C++ project. Go to &lt;STRONG&gt;&lt;EM&gt;menu &amp;gt; File &amp;gt; New &amp;gt; MQX4.1 Project&lt;/EM&gt;&lt;/STRONG&gt; and in the Wizard “&lt;STRONG&gt;&lt;EM&gt;Select Application type and template&lt;/EM&gt;&lt;/STRONG&gt;” window select &lt;STRONG&gt;&lt;EM&gt;Examples Application &amp;gt; Basic examples &amp;gt; cplus&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="text-indent: -0.25in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4) &lt;/SPAN&gt;In menu &lt;STRONG&gt;&lt;EM&gt;Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; ARM Ltd Windows GCC C++ Compiler &amp;gt; Directories&lt;/EM&gt;&lt;/STRONG&gt; add &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 10pt;"&gt;"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include"&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; and put the below paths &lt;/SPAN&gt;&lt;STRONG style="color: #c00000;"&gt;at the&lt;/STRONG&gt; &lt;STRONG style="color: #c00000;"&gt;end&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt; of the Compiler Directories list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 10pt;"&gt;"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 10pt;"&gt;"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C/include"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;5) Then in &lt;STRONG&gt;&lt;EM&gt;menu Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Librarian&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp; check "&lt;STRONG&gt;&lt;EM&gt;Enable automatic library configurations&lt;/EM&gt;&lt;/STRONG&gt;" and choose "&lt;STRONG&gt;&lt;EM&gt;Model&lt;/EM&gt;&lt;/STRONG&gt;" = ewl_c++ / int / int.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;6) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Finally, if you replaced &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdout&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; for &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;_mqxio_stdout &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;(in step 2) you need to do the same in cplus.cpp and build the project.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Carlos&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Apr 2014 20:35:56 GMT</pubDate>
    <dc:creator>Carlos_Musich</dc:creator>
    <dc:date>2014-04-07T20:35:56Z</dc:date>
    <item>
      <title>MQX C++ project in CodeWarrior</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307530#M9861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to develop a C++ project with TWR-K60D100M (MK60DN512VMD10 Kinetics MCU), using MQX(version 4.0.2). I am using the CodeWarrior v10.5. I have followed the procedure from this thread (&lt;A _jive_internal="true" data-containerid="2023" data-containertype="14" data-objectid="305191" data-objecttype="1" href="https://community.nxp.com/thread/305191"&gt;EWL C++ in MQX.&lt;/A&gt;) and am able to build and run the cplus example application. I would now like to create a new project with the same settings and I am unable to do that so far. I have the following doubts regarding this problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Do I need to select the GCC or the Freescale option in the ARM build tools option while creating the project? What's the difference between the two? Is one better than the other for a c++ project?&lt;/P&gt;&lt;P&gt;2. I selected the GCC option because the cplus example project uses that. But there is no option to select the language while creating a new project and by default, project properties -&amp;gt; C/C++ build -&amp;gt; Settings -&amp;gt; tool settings shows the &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;GCC C compiler&lt;/STRONG&gt;&lt;/SPAN&gt; instead of the &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;GCC C++ compiler&lt;/STRONG&gt;&lt;/SPAN&gt; in the example cplus project. How can this be changed?&lt;/P&gt;&lt;P&gt;3. I tried doing what &lt;A _jive_internal="true" data-containerid="2023" data-containertype="14" data-objectid="118652" data-objecttype="1" href="https://community.nxp.com/thread/118652"&gt;use c++ with/in mqx&lt;/A&gt; thread says, but there is no 'Force C++ compilation' option when the GCC compiler is selected and merely changing the filename from .h to .hpp seems rather hacky (or is it?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, are there any other known issues of using MQX to write C++ projects (As this &lt;A _jive_internal="true" data-containerid="2023" data-containertype="14" data-objectid="365702" data-objecttype="2" href="https://community.nxp.com/message/365702#365702"&gt;Re: Bug: Cpp Example - Global Object with new/malloc in Construct&lt;/A&gt; thread seems to suggest)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be immensely grateful for any leads on these issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Neerav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 08:13:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307530#M9861</guid>
      <dc:creator>neerav</dc:creator>
      <dc:date>2014-04-01T08:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: MQX C++ project in CodeWarrior</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307531#M9862</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 also would like to do this. I'm pretty sure you should select the GCC option it will be the compiler of preference moving forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dennis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 23:41:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307531#M9862</guid>
      <dc:creator>dkh</dc:creator>
      <dc:date>2014-04-02T23:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: MQX C++ project in CodeWarrior</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307532#M9863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;HI N&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;eerav,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Below you can find what worked for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; 1) &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Add the following macros in &lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\config\&amp;lt;board&amp;gt;\user_config.h&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt; &lt;SPAN style="color: black;"&gt;MQX_SUPPRESS_FILE_DEF&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt; &lt;SPAN style="color: black;"&gt;BSPCFG_ENABLE_CPP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt; &lt;SPAN style="color: black;"&gt;MQX_SUPPRESS_STDIO_MACROS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #1f497d;"&gt;MQX_SUPRESS_FILE_DEF&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt; disables definition of FILE. EWL has its own FILE with different meaning, thus, EWL should link with EWL’s FILE, MQX should link with MQX_FILE, but the linking order is only one – you either take FILE from MQX or from EWL. Therefore we disable, with this macro, MQX to define FILE. Then MQX has to use MQX_FILE and EWL can continue using EWL FILE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #1f497d;"&gt;BSPCFG_ENABLE_CPP&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt; enables EWL functions required when using c++. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #1f497d;"&gt;MQX_SUPRESS_STDIO_MACROS&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; Similar as MQX_SUPRESS_FILE_DEF, stdio macros are different files (MQX_FILE) than EWL definitions, different pointer in memory and different structure members. Then, MQX must use its own definitions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;2) &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Now, stdin, stdout and stderr definitions must be redefined. To do this there are 2 options.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 67px;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;A)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;The correct way would be to add the following macros in &lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\mqx\source\include\fio.h. &lt;/EM&gt;&lt;/STRONG&gt;Recompile BSP and PSP (&lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\mqx\build\cw10gcc\bsp_&amp;lt;board&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;C:\Freescale\Freescale_MQX_4_1\mqx\build\cw10gcc\psp_&amp;lt;board&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt;). Errors will appear, go to each of them and replace &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdin&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; for &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;_mqxio_stdin&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; and &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdout&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; for &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;_mqxio_stdout. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Recompile again, no errors should appear this time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt; _mqxio_stdin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (MQX_FILE_PTR)_io_get_handle(IO_STDIN)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt; _mqxio_stdout&amp;nbsp;&amp;nbsp;&amp;nbsp; (MQX_FILE_PTR)_io_get_handle(IO_STDOUT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt; font-family: Consolas;"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt; _mqxio_stderr&amp;nbsp;&amp;nbsp;&amp;nbsp; (MQX_FILE_PTR)_io_get_handle(IO_STDERR)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 90px;"&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 67px;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;B)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;A work around would be to force the project to use &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdin&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdout&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; and &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stderr &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;by taking these defines out of the #if directive. With the default build settings the linker will use the MQX definitions, the side effect is that after recompiling BSP and PSP warnings will appear alerting that these macros are redefined.&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;&lt;SPAN class="pasted-list-info"&gt;1)&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pasted-list-info"&gt;&lt;/SPAN&gt;3) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Now you can create a new C++ project. Go to &lt;STRONG&gt;&lt;EM&gt;menu &amp;gt; File &amp;gt; New &amp;gt; MQX4.1 Project&lt;/EM&gt;&lt;/STRONG&gt; and in the Wizard “&lt;STRONG&gt;&lt;EM&gt;Select Application type and template&lt;/EM&gt;&lt;/STRONG&gt;” window select &lt;STRONG&gt;&lt;EM&gt;Examples Application &amp;gt; Basic examples &amp;gt; cplus&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="text-indent: -0.25in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4) &lt;/SPAN&gt;In menu &lt;STRONG&gt;&lt;EM&gt;Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; ARM Ltd Windows GCC C++ Compiler &amp;gt; Directories&lt;/EM&gt;&lt;/STRONG&gt; add &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 10pt;"&gt;"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include"&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; and put the below paths &lt;/SPAN&gt;&lt;STRONG style="color: #c00000;"&gt;at the&lt;/STRONG&gt; &lt;STRONG style="color: #c00000;"&gt;end&lt;/STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt; of the Compiler Directories list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 10pt;"&gt;"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -0.25in; padding-left: 90px;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;o&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 10pt;"&gt;"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C/include"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;5) Then in &lt;STRONG&gt;&lt;EM&gt;menu Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Librarian&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp; check "&lt;STRONG&gt;&lt;EM&gt;Enable automatic library configurations&lt;/EM&gt;&lt;/STRONG&gt;" and choose "&lt;STRONG&gt;&lt;EM&gt;Model&lt;/EM&gt;&lt;/STRONG&gt;" = ewl_c++ / int / int.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN class="pasted-list-info"&gt;6) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Finally, if you replaced &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;stdout&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp; for &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: black; font-size: 10pt;"&gt;_mqxio_stdout &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;(in step 2) you need to do the same in cplus.cpp and build the project.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Carlos&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 20:35:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307532#M9863</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2014-04-07T20:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: MQX C++ project in CodeWarrior</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307533#M9864</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 created a document with this information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-101405"&gt;Creating a new MQX project using GCC C++&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2014 03:38:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307533#M9864</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2014-07-04T03:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: MQX C++ project in CodeWarrior</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307534#M9865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos&lt;/P&gt;&lt;P&gt;I followed instructions recompiled libraries. When I create a project and import codes from IAREW project, I encounter many problems, such as "'printf' was not declared in this scope" for instance. How to resolve it please help!&lt;/P&gt;&lt;P&gt;Thanks and regards!&lt;/P&gt;&lt;P&gt;Charlie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 06:32:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307534#M9865</guid>
      <dc:creator>charliemmao</dc:creator>
      <dc:date>2014-07-30T06:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: MQX C++ project in CodeWarrior</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307535#M9866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I followed the same steps as above and also encountered problems with printf, e.g. inside FFS library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually it should be &lt;/P&gt;&lt;P&gt;#define MQX_SUPPRESS_STDIO_MACROS 0&lt;/P&gt;&lt;P&gt;inside user_config.h. Otherwise there will be errors with printf functions (few libraries won't compile).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 13:34:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-C-project-in-CodeWarrior/m-p/307535#M9866</guid>
      <dc:creator>maciejwdowiarz-</dc:creator>
      <dc:date>2015-02-12T13:34:03Z</dc:date>
    </item>
  </channel>
</rss>

