Monday, 6. April 2009, 16:26:00
How to build Brew application with ARM Developer Suite(ADS).
Today im discovery how to build a brew app to lauching on mobile and some error we may get.
First step we have to make ARM make file,it’s a set of variable ,path,library need to build app brew,
Simple way we just click ARM Make in toolbar addins in eviroment (I use c++).
Second step(ofcourse we have install ADS on our computer LOL ).
We use nmake u tility of microsoft to build our app,start menuàRunàCMD
Move to directory our project locate. Use this statement nmake /f yourmakefile.
After that if success you’ll get your mod file,done progress build app.
SOME ERROR WE MAY GOT:
Some rule we have to follow when coding:
Each class must have new/delete overload,
no static/global data make
don't have any array of function pointers intialized at compile time. Initialize at run-time.
Don't call the assert CRT function.
Don't use floating point multiplication/division directly, instead use BREW functions like FP...
Another special error I got and I have solved it already.
When u make your makefile *.mak
Open your make file and edit
you will have a line like (for linker flag)
LFLAGS = $(LFLAGS) ....
modify it to
LFLAGS = $(LFLAGS) –verbose
in my case problem have been solve.
HOW TO FIX GLOBAL VARIABLE
A frequently question Asked : how can I write program not use global how to communicate between other function.
You will free for use global variable,in last step –build app—we will fix it in this step
Just create a stuct to store your global variable,create a variable type struct to hold all variable ,keep it in base class (the first class when app load).
When you use global variable u call it by struct .just spend 15’ to fix it in my case 14000++ line code.LOL
1) Use a global array instead of a global pointer:
#include <stdio.h>
const char str[] = "test";
int main(void)
{
printf ("%s",str);
}
2) Use a local pointer instead of a global pointer:
#include <stdio.h>int main(void)
{
char *str = "test";
printf ("%s",str);
}
3)
Please note that if you are using a list with multiple elements, such as:
char * list[] = {"zero", "one", "two"};
You will get a separate link error for each element in the array. In this case, the recommended solution is:
char list[3][5] = {"zero", "one", "two"};
4)When u lauching app to the real device.
notice: all file u got have the same in lowcase .brh .bar .brx
make a directory at /mod/yourappname
copy all file bar mod sig into yourappname
copy mif file of your app into Mif folder of system on device.
if you have another solution or problem let me know.....