Home > Developer > Developing BREW Application with VC++ Toolkit 2003

SophiaFramework : BREW  C++ Class Library & GUI Framework & XML Middleware

Developing BREW Application with VC++ Toolkit 2003

Microsoft Visual C++ Toolkit 2003, a set of vital compilers and linkers extracted from Microsoft Visual C++ .NET 2003 (Product Edition) is distributed for free.

Using this Toolkit and the free trial edition of SophiaFramework, you can develop BREW application that works on BREW emulators for free!

Download Microsoft Visual C++ Toolkit 2003

Download the toolkit from the following URL. Double click on the installer (CToolkitSetup.exe) to start the setup.


BREW programming

You can code BREW applications by using Microsoft Visual C++ .NET 2003. But since the BREW application wizard can not be used, you will need to write the skeleton code of the application by yourself.

See SophiaFramework tutorial "BREW HelloWorld with SophiaFramework" for help.

The following source code files, AEEAppGen.c and AEEModGen.c, are required to compile BREW applications. These files are in the src folder of BREW SDK installed on your machine. Copy these files into the same folder as your application.

After coding the application and generating bid files, compile them. Run Visual C++ Toolkit 2003 Command Prompt from [Program Menu] -> [Microsoft Visual C++ Toolkit 2003] -> [Visual C++ Toolkit 2003 Command Prompt] . Environment variables required for using Microsoft Visual C++ Toolkit 2003 are already configured in this command prompt.

Move to your application folder using the command prompt, then input the following command. (In this example, the name of your application is HelloWorld )

cl AEEAppGen.c AEEModGen.c HelloWorld.c /I
"C:\Program Files\BREW SDK v2.1.1 Ja\inc"
/D "AEE_SIMULATOR" /FD /MT /GS /nologo /c

Do not use linefeed. "C:\Program Files\BREW SDK v2.1.1" is the folder where you have installed BREW SDK.

After the compilation, object files will be generated, so input following commands to link them.

link /OUT:"./HelloWorld.dll" /NOLOGO 
/DLL AEEAppGen.obj AEEModGen.obj HelloWorld.obj

This completes the compilation. The generated file, HelloWorld.dll is the module file for the emulator.

Since the command lines used for compilation are lengthy, it is suggested to generate a make file for it.

Using SophiaFramework

The compilation method will change when you use SophiaFramework. You don't need to copy AEEAppGen.c and AEEModGen.c, also the command options for compileation and linking will change.

This is the command line for compilation.

cl HelloWorld.cpp /I "C:\Program Files\BREW SDK v2.1.1 Ja\inc"
/I "C:\Program Files\Sophia Cradle\SophiaFramework\3.0.0J\Include" 
/D "AEE_SIMULATOR" /FD /MT /GS /nologo /c

* No linefeed.

"C:\Program Files\Sophia Cradle\SophiaFramework\3.0.0\" is the installed folder of SophiaFramework.

Link command is ;

link /OUT:"./HelloWorld.dll" /NOLOGO /DLL /NODEFAULTLIB:LIBCMTD.lib
"C:\Program Files\Sophia Cradle\SophiaFramework\3.0.0J\Library
\SophiaFrameworkBrew210NET.lib" HelloWorld.obj 

Link the "SophiaFrameworkBrew210NET.lib" found in the Library folder of SophiaFramework. Do not forget to assign NODEFAULTLIB:LIBCMTD.lib

Configuring environmental path

In the command line above, include folders and library folders had to be assigned every time. But there would be no need to do this if the BREW SDK and the include folders of SophiaFramework were registered in the environment path INCLUDE, and the library folders of SophiaFramework in LIB.