www.digitalmars.com         C & C++   DMDScript  

c++.wxwindows - out of memory error

reply chris elliott <biol75 york.ac.uk> writes:
Digital Mars C/C++ Compiler Version 8.42.5n

I have a program with about 8000 lines of code, and recently added a new 
member function


bool MyFrame::CopyTemplate (const wxString & sFile, const wxString & 
sDestName, const wxString & sTextToReplace)
{

     wxString sCode = sExeRoot + sCodeDir;
     sCode = sCode + wxFILE_SEP_PATH ;
// real code ommitted
     return FALSE;
}

If I comment out the 2 sCode lines all is well, but with them in I get 
the error message shown below. How can i debug the memory error?

C:\wx\wxhatch>make -d -f makefile.dmc
file 'wxhatch_wxhatch.obj' is older than '.\wxhatch.cpp'
dmc -mn -c -owxhatch_wxhatch.obj -g -o+none -D_WIN32_WINNT=0x0400 
-D__WXMSW__ -D
__WXDEBUG__  -Ic:\wx\WXWIDG~1.0\include 
-Ic:\wx\WXWIDG~1.0\lib\dmc_lib\mswd -w-
-I. -WA -Ic:\wx\WXWIDG~1.0\samples -DNOPCH -Ar -Ae 
-Ic:\wx\WXWIDG~1.0\contrib\
include  .\wxhatch.cpp
Fatal error: out of memory
--- errorlevel 1
May 16 2005
next sibling parent reply "dt" <tinkham ucalgary.ca> writes:
"chris elliott" <biol75 york.ac.uk> wrote in message
news:d69ria$1gj3$1 digitaldaemon.com...
 Digital Mars C/C++ Compiler Version 8.42.5n

 I have a program with about 8000 lines of code, and recently added a new
 member function


 bool MyFrame::CopyTemplate (const wxString & sFile, const wxString &
 sDestName, const wxString & sTextToReplace)
 {

      wxString sCode = sExeRoot + sCodeDir;
      sCode = sCode + wxFILE_SEP_PATH ;
 // real code ommitted
      return FALSE;
 }

 If I comment out the 2 sCode lines all is well, but with them in I get
 the error message shown below. How can i debug the memory error?

Hi Chris, Don't know, it sounds weird. But, have you tried the -HPxx compiler switch. See here http://www.digitalmars.com/ctg/ctg.html I think(?) the default is -HP30, for 30 MB memory pool. I've had to use about 90 MB in some of my builds. A word of caution if you are using the IDDE (which it looks like you are not). After setting the -HP switch in the IDDE, it looks like you actually have to close and re-open the IDDE for the setting to take effect; at least I did, and it caused a bit of headache. Doug
May 16 2005
parent reply chris elliott <biol75 york.ac.uk> writes:
dt wrote:

 See here http://www.digitalmars.com/ctg/ctg.html
 
 I think(?) the default is -HP30, for 30 MB memory pool.  I've had to use
 about 90 MB in some of my builds.
 

fix in either the output of dmc or on the http://www.digitalmars.com/ctg/ctg.html web page chris
May 31 2005
parent "dt" <tinkham ucalgary.ca> writes:
"chris elliott" <biol75 york.ac.uk> wrote in message
news:d7hi2i$1hbr$1 digitaldaemon.com...
 thanks doug, this was a good fix. I didn't find a reference for the -HP
 fix in either the output of dmc or on the
 http://www.digitalmars.com/ctg/ctg.html web page

 chris

No problem. In the left pane, Tools->DMC, it is listed as a compiler switch on the web page. Cheers Doug
May 31 2005
prev sibling parent "Walter" <newshound digitalmars.com> writes:
It could be running out of memory because of a recursive expansion of a
template or function. Can you try to cut it down to a minimal program?
May 16 2005