Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi All,

Iam new in Brew.Sorry in advance if my question is a bad question.

My question is, is Ms Visual studio 6.0 is must for to create a MIf and .dll in brew.

Is there is ny other way to create a .dll. Is any seperate MIF editor is available.

Plz help me..it's urgent.

Thanks in advance,
Premlal

Visual studio is not created to create a Mif. A mif is created by a mif editor and is only invoked by visual studio.
Also u can use any developer tools that is capable of creating a dll, any complier will do.

Visual studio is not created to create a Mif. A mif is created by a mif editor and is only invoked by visual studio.
Also u can use any developer tools that is capable of creating a dll, any complier will do.

Thanks for ur reply. :cool: i create a mif file using mif editor.
Can i use an Eclipse to create a dll.Currently im working in j2me with eclipse.
I add a pluggin in Eclipse for to compile c and c++.But i don't know how to create a dll using ecilpse.
Thanks in advance
Premlal

Thanks for ur reply. :cool: i create a mif file using mif editor.
Can i use an Eclipse to create a dll.Currently im working in j2me with eclipse.
I add a pluggin in Eclipse for to compile c and c++.But i don't know how to create a dll using ecilpse.
Thanks in advance
Premlal

I managed to create a dll file for the emulator using Eclipse, CDT, MinGW, Brew SDK ver 2.0.1. The MIF file was created using the MIF editor which comes along with the SDK.
The Simulator lists the application but shows the error - ' This application has been unloaded to save memory. You must download a new version '
The app is placed in the examples folder of the SDK
D:\BREW_SDK_v2.0.1\Examples\Hope.mif
D:\BREW_SDK_v2.0.1\Examples\Hope
D:\BREW_SDK_v2.0.1\Examples\Hope\Hope.dll
I had modified the HelloWorld example for this application. However the size of the newly generated dll files is just 5k compared to the 28k HelloWorld dll file.
What could be problem. HELP
I made use of the make file downloaded from the forum(dllmake.zip) .
[CODE
#-----------------------------------------------------------------------
# Target File Name and Type Definitions
# (you'll need to specify a target name; i.e. what you want the
# program to be called)
#-----------------------------------------------------------------------
ifndef TARGET
TARGET = Hope
endif
EXETYPE = elf
BINARY = bin
#MODULE = mod
MODULE = dll
ifndef BREW_VER
#BREW_VER = 1.1
BREW_VER = 2.0
endif
#-----------------------------------------------------------
# Additional objects apart from $(TARGET).o
#-----------------------------------------------------------
#ADD_OBJS = GCCResolver.o
#ADD_OBJS = AEEMediaUtil.o TextWin.o
#Don't seem to need GCCResolver, but these other .o are created during
#compilation. If their compilation not handled automatically, you can
#uncomment the above line.
#-----------------------------------------------------------------------
# Set the object files that we care about
# (if your program has more than one source file, you'll need to add
# the rest of them to this list (changing the extension to .o))
#-----------------------------------------------------------------------
APP_OBJS = AEEModGen.o AEEAppGen.o $(ADD_OBJS) $(TARGET).o
#APP_OBJS = AEEModGen.o AEEAppGen.o GCCResolver.o $(TARGET).o
#-----------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a simulator app.
# Also works around Microsoft's syntax for 64 bit integers.
# Note that there are two underscore characters in -D__int.
#-----------------------------------------------------------------------
#DEFINES = -DDYNAMIC_APP
DEFINES = -DAEE_SIMULATOR -D__int64=long\ long
#-----------------------------------------------------------------------
# Software tool and environment definitions
# (GCCHOMEPATH needs to be set to the location of your gcc cross-compiler
# and binutils. ELF2MODTOOLPATH needs to set to the location of of
# BREWelf2mod.exe)
# In the .dll case we are not creating .elf files.
#-----------------------------------------------------------------------
ifndef GCCHOMEPATH
#GCCHOMEPATH = c:/gnude
GCCHOMEPATH = d:/cygwin
endif
ifndef GNUHOMEPATH
GNUHOMEPATH = c:/gnude
endif
GCCBINPATH = $(GCCHOMEPATH)/bin
#ELF2MODTOOLPATH = $(GCCHOMEPATH)
#-----------------------------------------------------------
# Fix the path here to location of AEEAppGen.c and AEEModGen.c
#-----------------------------------------------------------
AEESRCPATH = D:/BREW_SDK_v2.0.1/src
#-----------------------------------------------------------
# Fix the path here to location of BREW header files
#-----------------------------------------------------------
AEEINCPATH = D:/BREW_SDK_v2.0.1/inc
#GCC = $(GCCBINPATH)/arm-elf-gcc.exe
GCC = D:/MinGW/bin/gcc.exe
#LD = $(GCCBINPATH)/arm-elf-ld.exe
LD = D:/MinGW/bin/ld.exe
#ELF2MODTOOL = $(ELF2MODTOOLPATH)/BREWelf2mod.exe
#-----------------------------------------------------------------------
# Compiler optimization options
# -O0 disables compiler optimizations. Other options probably work as
# well. Set to taste.
#-----------------------------------------------------------------------
OPT = -O2
#OPT = -O3 -Os -Wall
#-----------------------------------------------------------------------
# Compiler code generation options
# Add $(TARG) to the CODE line if you're building a Thumb binary (at
# the moment, this doesn't work).
#-----------------------------------------------------------------------
#END = -mlittle-endian
#TARG = -mthumb
#CODE = $(END) -fshort-enums -fno-builtin
CODE = -fno-exceptions -fshort-enums -fno-builtin
#-----------------------------------------------------------------------
# Include file search path options
# (change this to point to where the BREW SDK headers are located)
#-----------------------------------------------------------------------
#INC = -I$(AEEINCPATH) -I$(GCCHOMEPATH)\lib\gcc-lib\arm-elf\3.3.1\include -I$(GCCHOMEPATH)\arm-elf\3.3.1\include
INC = -I$(AEEINCPATH)
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a
#-----------------------------------------------------------------------
#LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1
#-----------------------------------------------------------------------
# Nothing below here (except for the dependencies at the bottom of the
# file) should need to be changed for a reasonably normal compilation.
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# Processor architecture options
# Sets the designated target processor for this applet.
# Currently, all BREW phones use the ARM 7t chip
# For .dll creation, we don't need to worry about the chip
#-----------------------------------------------------------------------
#CPU = -mcpu=arm7tdmi
#-----------------------------------------------------------------------
# ARM Procedure Call Standard (APCS) options
# -fPIC sets posititon independent code. Other option: -fpic
# -mthumb-interwork enables switching between ARM and Thumb code
# -mapcs-frame runs on systems with the frame ptr. specified in the
# APCS
#-----------------------------------------------------------------------
#ROPI =
#INTRWK = -mthumb-interwork
#APCS = -mapcs-frame $(ROPI) $(INTRWK)
#-----------------------------------------------------------------------
# Compiler output options
# -c sets object file output only
#-----------------------------------------------------------------------
OUT = -c
#-----------------------------------------------------------------------
# Compiler/assembler debug Options
# -g is the standard flag to leave debugging information in the
# object files.
#-----------------------------------------------------------------------
#DBG = -g
DBG =
#-----------------------------------------------------------------------
# Compiler flag definitions
#-----------------------------------------------------------------------
#CFLAGS0 = $(OUT) $(DEFINES) $(CPU) $(APCS) $(CODE) $(DBG)
#CFLAGS = $(CFLAGS0) $(INC) $(OPT)
CFLAGS = $(OUT) $(OPT) $(INC) $(CODE) $(DEFINES) $(DBG)
#-----------------------------------------------------------------------
# Linker Options
# -o sets the output filename
#-----------------------------------------------------------------------
#LINK_CMD = -Ttext 0 --emit-relocs -entry AEEMod_Load -o
LINK_CMD = -s -shared -static -nostdlib -o
LIBS = -lgcc
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
#LDFLAGS = $(LIBDIRS)
#-----------------------------------------------------------------------
# Default target
#-----------------------------------------------------------------------
default: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Targets for making the actual binary
# Won't use ELF2MODTOOL to create .dll
#-----------------------------------------------------------------------
#$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
# $(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
#$(TARGET).$(EXETYPE) : $(APP_OBJS)
# $(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
# $(APP_OBJS) $(LIBS) $(LINK_ORDER)
# Will try without $(LIBS), may not matter
#$(TARGET).$(MODULE) : $(APP_OBJS)
# $(LD) $(LINK_CMD) $(TARGET).$(MODULE) $(APP_OBJS) $(LIBS)
#$(TARGET).$(MODULE) : $(APP_OBJS)
# $(LD) $(LINK_CMD) $(TARGET).$(MODULE) $(APP_OBJS)
$(TARGET).$(MODULE) : $(APP_OBJS)
$(LD) $(LINK_CMD) $(TARGET).$(MODULE) *.o
#-----------------------------------------------------------------------
# Cleanup
#-----------------------------------------------------------------------
clean:
rm -f $(APP_OBJS) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(TARGET).o: $(TARGET).c
AEEAppGen.o:
$(GCC) $(CFLAGS) -o AEEAppGen.o $(AEESRCPATH)/AEEAppGen.c
AEEModGen.o:
$(GCC) $(CFLAGS) -o AEEModGen.o $(AEESRCPATH)/AEEModGen.c
#New lines below, maybe these two files can be autogenerated
#AEEMediaUtil.o:
# $(GCC) $(CFLAGS) -o AEEMediaUtil.o $(AEESRCPATH)/AEEMediaUtil.c
#TextWin.o:
# $(GCC) $(CFLAGS) -o TextWin.o $(AEESRCPATH)/TextWin.c
#GCCResolver.o:
# $(GCC) $(CFLAGS) -o GCCResolver.o $(GCCHOMEPATH)/GCCResolver.c
.c.o:
$(GCC) -c $(CFLAGS) -o $@ $<[/CODE]

I managed to create a dll file for the emulator using Eclipse, CDT, MinGW, Brew SDK ver 2.0.1. The MIF file was created using the MIF editor which comes along with the SDK.
The Simulator lists the application but shows the error - ' This application has been unloaded to save memory. You must download a new version '
The app is placed in the examples folder of the SDK
D:\BREW_SDK_v2.0.1\Examples\Hope.mif
D:\BREW_SDK_v2.0.1\Examples\Hope
D:\BREW_SDK_v2.0.1\Examples\Hope\Hope.dll
I had modified the HelloWorld example for this application. However the size of the newly generated dll files is just 5k compared to the 28k HelloWorld dll file.
What could be problem. HELP
I made use of the make file downloaded from the forum(dllmake.zip) .
[CODE
#-----------------------------------------------------------------------
# Target File Name and Type Definitions
# (you'll need to specify a target name; i.e. what you want the
# program to be called)
#-----------------------------------------------------------------------
ifndef TARGET
TARGET = Hope
endif
EXETYPE = elf
BINARY = bin
#MODULE = mod
MODULE = dll
ifndef BREW_VER
#BREW_VER = 1.1
BREW_VER = 2.0
endif
#-----------------------------------------------------------
# Additional objects apart from $(TARGET).o
#-----------------------------------------------------------
#ADD_OBJS = GCCResolver.o
#ADD_OBJS = AEEMediaUtil.o TextWin.o
#Don't seem to need GCCResolver, but these other .o are created during
#compilation. If their compilation not handled automatically, you can
#uncomment the above line.
#-----------------------------------------------------------------------
# Set the object files that we care about
# (if your program has more than one source file, you'll need to add
# the rest of them to this list (changing the extension to .o))
#-----------------------------------------------------------------------
APP_OBJS = AEEModGen.o AEEAppGen.o $(ADD_OBJS) $(TARGET).o
#APP_OBJS = AEEModGen.o AEEAppGen.o GCCResolver.o $(TARGET).o
#-----------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a simulator app.
# Also works around Microsoft's syntax for 64 bit integers.
# Note that there are two underscore characters in -D__int.
#-----------------------------------------------------------------------
#DEFINES = -DDYNAMIC_APP
DEFINES = -DAEE_SIMULATOR -D__int64=long\ long
#-----------------------------------------------------------------------
# Software tool and environment definitions
# (GCCHOMEPATH needs to be set to the location of your gcc cross-compiler
# and binutils. ELF2MODTOOLPATH needs to set to the location of of
# BREWelf2mod.exe)
# In the .dll case we are not creating .elf files.
#-----------------------------------------------------------------------
ifndef GCCHOMEPATH
#GCCHOMEPATH = c:/gnude
GCCHOMEPATH = d:/cygwin
endif
ifndef GNUHOMEPATH
GNUHOMEPATH = c:/gnude
endif
GCCBINPATH = $(GCCHOMEPATH)/bin
#ELF2MODTOOLPATH = $(GCCHOMEPATH)
#-----------------------------------------------------------
# Fix the path here to location of AEEAppGen.c and AEEModGen.c
#-----------------------------------------------------------
AEESRCPATH = D:/BREW_SDK_v2.0.1/src
#-----------------------------------------------------------
# Fix the path here to location of BREW header files
#-----------------------------------------------------------
AEEINCPATH = D:/BREW_SDK_v2.0.1/inc
#GCC = $(GCCBINPATH)/arm-elf-gcc.exe
GCC = D:/MinGW/bin/gcc.exe
#LD = $(GCCBINPATH)/arm-elf-ld.exe
LD = D:/MinGW/bin/ld.exe
#ELF2MODTOOL = $(ELF2MODTOOLPATH)/BREWelf2mod.exe
#-----------------------------------------------------------------------
# Compiler optimization options
# -O0 disables compiler optimizations. Other options probably work as
# well. Set to taste.
#-----------------------------------------------------------------------
OPT = -O2
#OPT = -O3 -Os -Wall
#-----------------------------------------------------------------------
# Compiler code generation options
# Add $(TARG) to the CODE line if you're building a Thumb binary (at
# the moment, this doesn't work).
#-----------------------------------------------------------------------
#END = -mlittle-endian
#TARG = -mthumb
#CODE = $(END) -fshort-enums -fno-builtin
CODE = -fno-exceptions -fshort-enums -fno-builtin
#-----------------------------------------------------------------------
# Include file search path options
# (change this to point to where the BREW SDK headers are located)
#-----------------------------------------------------------------------
#INC = -I$(AEEINCPATH) -I$(GCCHOMEPATH)\lib\gcc-lib\arm-elf\3.3.1\include -I$(GCCHOMEPATH)\arm-elf\3.3.1\include
INC = -I$(AEEINCPATH)
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a
#-----------------------------------------------------------------------
#LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1
#-----------------------------------------------------------------------
# Nothing below here (except for the dependencies at the bottom of the
# file) should need to be changed for a reasonably normal compilation.
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# Processor architecture options
# Sets the designated target processor for this applet.
# Currently, all BREW phones use the ARM 7t chip
# For .dll creation, we don't need to worry about the chip
#-----------------------------------------------------------------------
#CPU = -mcpu=arm7tdmi
#-----------------------------------------------------------------------
# ARM Procedure Call Standard (APCS) options
# -fPIC sets posititon independent code. Other option: -fpic
# -mthumb-interwork enables switching between ARM and Thumb code
# -mapcs-frame runs on systems with the frame ptr. specified in the
# APCS
#-----------------------------------------------------------------------
#ROPI =
#INTRWK = -mthumb-interwork
#APCS = -mapcs-frame $(ROPI) $(INTRWK)
#-----------------------------------------------------------------------
# Compiler output options
# -c sets object file output only
#-----------------------------------------------------------------------
OUT = -c
#-----------------------------------------------------------------------
# Compiler/assembler debug Options
# -g is the standard flag to leave debugging information in the
# object files.
#-----------------------------------------------------------------------
#DBG = -g
DBG =
#-----------------------------------------------------------------------
# Compiler flag definitions
#-----------------------------------------------------------------------
#CFLAGS0 = $(OUT) $(DEFINES) $(CPU) $(APCS) $(CODE) $(DBG)
#CFLAGS = $(CFLAGS0) $(INC) $(OPT)
CFLAGS = $(OUT) $(OPT) $(INC) $(CODE) $(DEFINES) $(DBG)
#-----------------------------------------------------------------------
# Linker Options
# -o sets the output filename
#-----------------------------------------------------------------------
#LINK_CMD = -Ttext 0 --emit-relocs -entry AEEMod_Load -o
LINK_CMD = -s -shared -static -nostdlib -o
LIBS = -lgcc
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
#LDFLAGS = $(LIBDIRS)
#-----------------------------------------------------------------------
# Default target
#-----------------------------------------------------------------------
default: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Targets for making the actual binary
# Won't use ELF2MODTOOL to create .dll
#-----------------------------------------------------------------------
#$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
# $(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
#$(TARGET).$(EXETYPE) : $(APP_OBJS)
# $(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
# $(APP_OBJS) $(LIBS) $(LINK_ORDER)
# Will try without $(LIBS), may not matter
#$(TARGET).$(MODULE) : $(APP_OBJS)
# $(LD) $(LINK_CMD) $(TARGET).$(MODULE) $(APP_OBJS) $(LIBS)
#$(TARGET).$(MODULE) : $(APP_OBJS)
# $(LD) $(LINK_CMD) $(TARGET).$(MODULE) $(APP_OBJS)
$(TARGET).$(MODULE) : $(APP_OBJS)
$(LD) $(LINK_CMD) $(TARGET).$(MODULE) *.o
#-----------------------------------------------------------------------
# Cleanup
#-----------------------------------------------------------------------
clean:
rm -f $(APP_OBJS) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(TARGET).o: $(TARGET).c
AEEAppGen.o:
$(GCC) $(CFLAGS) -o AEEAppGen.o $(AEESRCPATH)/AEEAppGen.c
AEEModGen.o:
$(GCC) $(CFLAGS) -o AEEModGen.o $(AEESRCPATH)/AEEModGen.c
#New lines below, maybe these two files can be autogenerated
#AEEMediaUtil.o:
# $(GCC) $(CFLAGS) -o AEEMediaUtil.o $(AEESRCPATH)/AEEMediaUtil.c
#TextWin.o:
# $(GCC) $(CFLAGS) -o TextWin.o $(AEESRCPATH)/TextWin.c
#GCCResolver.o:
# $(GCC) $(CFLAGS) -o GCCResolver.o $(GCCHOMEPATH)/GCCResolver.c
.c.o:
$(GCC) -c $(CFLAGS) -o $@ $<[/CODE]

The error that you are encountering is seen only when the dll is not in the correct folder or it is not present. Please recheck if the dll and the bar file is in
D:\BREW_SDK_v2.0.1\Examples\Hope folder

The error that you are encountering is seen only when the dll is not in the correct folder or it is not present. Please recheck if the dll and the bar file is in
D:\BREW_SDK_v2.0.1\Examples\Hope folder

Thanks for ur reply.I identified the correct problem
My .dll and mif direcories are correct.
My operating system is windows XP.I copied all thece in to another machine which has windows 2000.And compiled and made a .dll file.And loaded in emulator.
Then it works fine.
Is there is any compilation deffrence exists in Xp and 2000.
Premlal

Thanks for ur reply.I identified the correct problem
My .dll and mif direcories are correct.
My operating system is windows XP.I copied all thece in to another machine which has windows 2000.And compiled and made a .dll file.And loaded in emulator.
Then it works fine.
Is there is any compilation deffrence exists in Xp and 2000.
Premlal

I have used both the o/s but never faced any problem. Anyways its good to hear that the problem is solved. But if you get to know what had actually caused this problem the post it here so that others wont face the same issue

I have used both the o/s but never faced any problem. Anyways its good to hear that the problem is solved. But if you get to know what had actually caused this problem the post it here so that others wont face the same issue

In Xp it is not worked.But in 2000 it workes fine.I don't know what is the problem.
Im planning to change my OS from XP to 2000.Is any one face this situation? please help.
MinGW-5.0.2 and Eclipse CDT is used for to create a .dll.
SDK version is BREW_SDK_v2.0.1.
Both SDK and MinGW 5.0.2 is installed in same drive(D:).
Premlal

In Xp it is not worked.But in 2000 it workes fine.I don't know what is the problem.
Im planning to change my OS from XP to 2000.Is any one face this situation? please help.
MinGW-5.0.2 and Eclipse CDT is used for to create a .dll.
SDK version is BREW_SDK_v2.0.1.
Both SDK and MinGW 5.0.2 is installed in same drive(D:).
Premlal

Then the problem surely must be with some compilation switches that are used by this compiler. Since i remember I had faced a similar problem when i had changed the compiler switches while integrating stride studio with the simulator.

Then the problem surely must be with some compilation switches that are used by this compiler. Since i remember I had faced a similar problem when i had changed the compiler switches while integrating stride studio with the simulator.

Hi Unmesh,
Thanks for ur quick reply.
Can u please expalin this with some more details.
Thanks in advance
Premlal

Hi Unmesh,
Thanks for ur quick reply.
Can u please expalin this with some more details.
Thanks in advance
Premlal

Problem is with the makefile.I commented this line (OPT = -O2 ) in makefile and compiled .
Then it works fine XP also.Sorry for the late reply.

Problem is with the makefile.I commented this line (OPT = -O2 ) in makefile and compiled .
Then it works fine XP also.Sorry for the late reply.