|
c1xx : fatal error C1060: compiler is out of heap space
This error comes up four times, with four diffrent files. As far as I can see, this has something to do with #includes.
------------------------------
The great successful men of the world have used their imagination...they think ahead and create their mental picture in all its details, filling in here, adding a little there, altering this a bit and that a bit, but steadily building-steadily buildings. (Robert Collier)
|
|
|
|
|
Hm... did you actually set a high swap file size?
according to the docs, a *high* /Zm makes sense
Does it get better with moving headers to/from stdafx.h?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Well, win xp pro is telling me that total size of all paging files is 3068 MB, so I'm assuming that it's not a problem. Windows manages the size of those files and I got *plenty* of disk space, so I think I should be covered there...;P
I tried to move the file tables.h (with the array) to stdafx.h, but seemingly to help. stdafx.cpp compiled, after a long while, without reporting any problems, but all the other source files reported the same error.
|
|
|
|
|
You do declare the array as "extern CString yadda[][][], do you?
Can you, just for a test, reduce the CString array to [1][1][1], or even better, declare as
typedef CString[b][c] CStringMatrix;
extern CStringMatrix * array;
and instantiate it as
CStringMatrix * array = new CStringMatrix[a];
this should change nothing syntactically when using accessing the array, but moves it to the heap.
Just to see if the array is really the culprit
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Actually, being the newbie that I am, I didn't use extern, but it doesn't seem to make a diffrence in itself.
I tried to experiment with which number I could use with /Zm. I get "out of heap space" at about 128, while setting the value to default, 127, gives "fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit".
I tried to use extern CString yadda[1][1][1], which worked out quite OK, actually, as long as I didn't exceed 127...
Now, It seems the real question is: isn't a little below 3GB large enough swap file?
|
|
|
|
|
OldViking wrote:
I didn't use extern, but it doesn't seem to make a diffrence in itself
But it definitely does (maybe not for your problem, but in terms of C++)
if you use
int x;
in a header file, every .cpp that includes it gets it's own instance of x. To get a "truly global" x, you need to declare
extern int x;
in the header file, and
int x = 0;
(or any other initializer value) in one .cpp file.
On the main topic, I'm out of ideas. might be this *is* a problem with the compiler. The only option that I see is moving the array to the heap, as described earlier. Sorry.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hmmm... seems like I have found a solution. The compiler gives more room for change in /Zm when I clean the temp files before rebuilding after changing the number. In other words, I changed the /Zm number to 900, and chose clean on the build menu before building. That worked, but gives me two questions I am curious about. Why do I need to clean first to get a effect? Why does the number need to be som much bigger on VStudio.net vs. VS 6.0?
Can you somehow answer this?
|
|
|
|
|
Have you tried to dynamically allocate the array on the heap using the new operator? It may be a better solution. You may even want to wrap it in a class to manage computing the offsets into a linear array from your x, y, z coordinates...
Just allocate the array as linear:
CString *m_pScores;
m_pScores = new CString(18*12*50);
then when accessing them, compute the offset
CString GetScore(int iX, int iY, int iZ)
{
return *(m_pScores[iX * iY * iZ]);
}
void SetScore(int iX, int iY, int iZ, CString cScore)
{
*(m_pScores[iX * iY * iZ]) = cScore;
}
onwards and upwards...
|
|
|
|
|
First off, maybe a dumb question: If you simply multiply x, y, and z coordinates, how can you be sure that you don't have multiple combinations which gives the same result. Won't this be a problem
Second, it's a reason for my setup. I have 18 written pages, with a table on each which I had to get into a computer. Done. The tables had 12 coloumns each, and each coloumn had 50 diffrent values. I pretty much need a solution that easy to insert those data. It might just be me, but 10800 * SetScore don't seem to me to be the best way to go...?
I was looking for a better way to create those tables, so I appreciate that, but I need to do it without creating source-code-hell
------------------------------
The great successful men of the world have used their imagination...they think ahead and create their mental picture in all its details, filling in here, adding a little there, altering this a bit and that a bit, but steadily building-steadily buildings. (Robert Collier)
|
|
|
|
|
When you use the ImageAttributes class to set the colour transformation matrix to draw an image, the only the fractional part of the resulting colour values are retained, so that the values don't go above 1.0.
Is there any way of instructing GDI+ to saturate the colour values intead (ie. if they're above 1.0, then set them to 1.0)? I can't find anything in the docs, but perhaps someone has already had to deal with this before...
Thanks
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I have a strange compiler error on my program. My compiler is Visual C++ .Net. The error is:
"error C2872: 'IServiceProvider' : ambiguous symbol"
on the file afxole.h of the MFC.
I don't understand what is the problem, because I don't use that class ...
Can you help me ?
Thank you very much for any answer.
Andrea
|
|
|
|
|
Are you programming a COM component? If so, have you initialized COM? in case of ambiguous symbol ... search msdn for C2872 and you'll get the following.
'symbol' : ambiguous symbol<br />
<br />
The compiler cannot determine which symbol you are referring to.<br />
<br />
The following sample generates C2872:<br />
<br />
namespace A<br />
{<br />
int i;<br />
}<br />
<br />
using namespace A;<br />
int i;<br />
void z()<br />
{<br />
::i++;
A::i++;
i++;
}<br />
-Tareq
|
|
|
|
|
Hi all of u
Can any one of u tell me how to lock the CD-ROM ????
Any c++ code or any idea???????
pl. help me.
|
|
|
|
|
I would use MCI. Send these 3 MCI strings:
open CDaudio alias cd sharable wait
set cd door locked wait
close cd wait This should lock the standard CD-ROM drive.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
|
thanks Ted Ferenc
Pl. email the source it to me
|
|
|
|
|
plz send me the code my id :-- ddrano7@gmail.com
thanks
|
|
|
|
|
I'm rotating text using escapement parameter in CFont::CreateFont(). Text is geting rotated correctly, but for Arial font, it becomes Bold when it is rotated by either of 90, 180 or 270 degrees.
Do I need to do any thing more for making normal and rotated text look alike?
Here's the code-
font.CreateFont(m_propbyFontSize * 1.5 * 20, 0, nRotationAngle * 10, 0, nFontWeight, bIsItalic, bIsUnderline, bIsStrikeout, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, m_propstrFontName);
This is important for me to fix ASAP.
Thanks in advance.
|
|
|
|
|
It doesn't change weight. If you print this on paper, you'll find that there is very little difference. There are two reasons. One is that the resolution of a screen is not particularly good. The other is that GDI can not rotate text very well. If it has to look better, try using GDI+, which does a far better job.
Hope this helps
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks for your valuable inputs. Now-
What needs to be done to do the same using GDI+. I need this to work on Windows 2k properly.
What's the minimum changes Can I do in my existing code to get support of GDI+?
Few things that are happening are-
The problem in only with certain fonts.
Arial is one of the font that is showing this problem.
Times New Roman is working fine.
Print preview as well as prints seem to be same for both Normal and Rotated texts.
|
|
|
|
|
Dhirendra wrote:
What's the minimum changes Can I do in my existing code to get support of GDI+?
You need to include "gdiplus.h" and link to the library, call GdiplusStartup() before you use GDI+ and call GdiplusShutdown() when you finish. You can create a graphics context from a GDI HDC by using Graphics g(hDC) (or Graphics g(dc.GetSafeHdc()) if you're using MFC). After that, you can start drawing in GDI+ however you like.
Look at one of the tutorials to get you started.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
whats the fastest formula/algorithm to determine if a number is a power of 2?
It's easy to check this in a while loop shifting the number 1 to the right and checking if it is 1, but perhaps there is a faster method?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
if(x & (x-1))
{
}
else
{
}
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Cool, thanks!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|