Newbie Font question (crash)

3 posts / 0 new
Last post
Jussi70
Jussi70's picture
Offline
Joined: 29 Aug 2011
Posts:
Newbie Font question (crash)

Nice library. Just learning to use it.

I have stuck to one error and cannot find solutions from the documentations.
When I try use/create font in my Screen constructor function:

MAUI::Font* font = new MAUI::Font(RES_FONT);

The program crashes when I run it: "Malloc failed. You most likely run out of heap memory. "
I can also see that when compiling I get a warning: "Runtime Warning: data section is too small for the stack, heap & BSS
(changed to -datasize=132468)". And I do not get this warning when compiling the tutorial project with font in it. So obviously something wrong in my project.
What I did is that I copied the resources.lst from one tutorial project and pasted it into my project. Then I added

#include
#include "MAHeaders.h"

At the beginning of the file.
Did I add font resources correctly by just copying and pasting the resource from another one? Or I need to do something else as well?
So how to add a font support to a project?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi, you need to allocate more memory to your project.  The default memory settings are very low.

You need to go into the build settings for your project - have a look at this here.  The thread here discusses values you can use for memory settings.

Hope this helps!

 

 

Jussi70
Jussi70's picture
Offline
Joined: 29 Aug 2011
Posts:

That solved the problem, thanks. I should have just followed the error message what is said.. :).