<?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>CodeWarrior Development Toolsのトピックhow to use new in a constructor then create a global object of class</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/how-to-use-new-in-a-constructor-then-create-a-global-object-of/m-p/423686#M2869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using codewarrior MCU 10.4 , mqx4.0, k20d72m board ,EWL&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching my program(&lt;SPAN class="j-attachment-name-chop"&gt;cplus.cpp&lt;/SPAN&gt;) , I need to use new in constructor then create a global object of class , when I do this my code crashes&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to edit the startup but my changes doesn't come to effect (when debugging the debugger goes into the commented function )&lt;/P&gt;&lt;P&gt;what are the steps to edit startup.c ?&lt;/P&gt;&lt;P&gt; (I tried to comment " bl __call_static_initializers " )&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I tried to give static heap by adding&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;__SP_INIT = . + 0x00004000;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__heap_addr = __SP_INIT;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__heap_size = 0x00004000;&amp;nbsp;&amp;nbsp; "&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to my linker file but it didn't work&amp;nbsp; I am attaching my linker file (un edited one ).&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I add static heap to this linker file&amp;nbsp; what are the changes to be made ?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337826"&gt;cplus.cpp.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337826"&gt;intflash.lcf.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 May 2015 15:42:07 GMT</pubDate>
    <dc:creator>josephxavier</dc:creator>
    <dc:date>2015-05-12T15:42:07Z</dc:date>
    <item>
      <title>how to use new in a constructor then create a global object of class</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/how-to-use-new-in-a-constructor-then-create-a-global-object-of/m-p/423686#M2869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using codewarrior MCU 10.4 , mqx4.0, k20d72m board ,EWL&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching my program(&lt;SPAN class="j-attachment-name-chop"&gt;cplus.cpp&lt;/SPAN&gt;) , I need to use new in constructor then create a global object of class , when I do this my code crashes&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to edit the startup but my changes doesn't come to effect (when debugging the debugger goes into the commented function )&lt;/P&gt;&lt;P&gt;what are the steps to edit startup.c ?&lt;/P&gt;&lt;P&gt; (I tried to comment " bl __call_static_initializers " )&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I tried to give static heap by adding&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;__SP_INIT = . + 0x00004000;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__heap_addr = __SP_INIT;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__heap_size = 0x00004000;&amp;nbsp;&amp;nbsp; "&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to my linker file but it didn't work&amp;nbsp; I am attaching my linker file (un edited one ).&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I add static heap to this linker file&amp;nbsp; what are the changes to be made ?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337826"&gt;cplus.cpp.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337826"&gt;intflash.lcf.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 15:42:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/how-to-use-new-in-a-constructor-then-create-a-global-object-of/m-p/423686#M2869</guid>
      <dc:creator>josephxavier</dc:creator>
      <dc:date>2015-05-12T15:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to use new in a constructor then create a global object of class</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/how-to-use-new-in-a-constructor-then-create-a-global-object-of/m-p/423687#M2870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joseph,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be helpful to know what are you trying to achieve, could you give us more information? do you want to use the malloc() function in your MQX project?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Carlos Mendoza&lt;/P&gt;&lt;P&gt;Technical Support Engineer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 21:50:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/how-to-use-new-in-a-constructor-then-create-a-global-object-of/m-p/423687#M2870</guid>
      <dc:creator>Carlos_Mendoza</dc:creator>
      <dc:date>2015-05-21T21:50:42Z</dc:date>
    </item>
  </channel>
</rss>

