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

Developer

Forums

I have set up Gnude and all the environment but when i run the bat file the compiler says 'muliple target patterns' and stop .If any comes with an make file for c++ application it would be so useful

plz urgent

See the one I provided in this thread (brewtest.mak.txt). It's for a multiple source file C++ application.
Hope this helps,
Simon
If it doesn't solve the problem, post your makefile here.

See the one I provided in this thread (brewtest.mak.txt). It's for a multiple source file C++ application.
Hope this helps,
Simon
If it doesn't solve the problem, post your makefile here.

Thanks a lot simon ..B/w i used ur make file and i had an weird error like this ....
Plz check and guide me
appdefs.cpp:166: error: `operator new' takes type `size_t' (`long unsigned int
') as first parameter

Thanks a lot simon ..B/w i used ur make file and i had an weird error like this ....
Plz check and guide me
appdefs.cpp:166: error: `operator new' takes type `size_t' (`long unsigned int
') as first parameter

Thanks a lot simon ..B/w i used ur make file and i had an weird error like this ....
Plz check and guide me
appdefs.cpp:166: error: `operator new' takes type `size_t' (`long unsigned int
') as first parameter

Thanks a lot simon ..B/w i used ur make file and i had an weird error like this ....
Plz check and guide me
appdefs.cpp:166: error: `operator new' takes type `size_t' (`long unsigned int
') as first parameter

Quote:Originally posted by simon
See the one I provided in this thread (brewtest.mak.txt). It's for a multiple source file C++ application.
Hope this helps,
Simon
If it doesn't solve the problem, post your makefile here.
Is appdefs.cpp one of your files?
That is a pretty weird error; please post appdefs.cpp (especially around the line the error occurs at.)
Are you overloading the global new and delete operators?

Quote:Originally posted by simon
See the one I provided in this thread (brewtest.mak.txt). It's for a multiple source file C++ application.
Hope this helps,
Simon
If it doesn't solve the problem, post your makefile here.
Is appdefs.cpp one of your files?
That is a pretty weird error; please post appdefs.cpp (especially around the line the error occurs at.)
Are you overloading the global new and delete operators?

yeah i'am overloding new and delete operators
What can be the look around for that
Plzz Plz ASAP

yeah i'am overloding new and delete operators
What can be the look around for that
Plzz Plz ASAP

I need to see some code before I can help you; I'm not a mindreader! ;)
Please post appdefs.cpp (in particular, the lines around the line causing the error) and all of the overloading operator code (prototypes + implementation).

I need to see some code before I can help you; I'm not a mindreader! ;)
Please post appdefs.cpp (in particular, the lines around the line causing the error) and all of the overloading operator code (prototypes + implementation).

void* operator new(unsigned int size)
{
return MALLOC(size);

void operator delete(void * ptr)
{
FREE(ptr);

void* operator new[](unsigned int n)
{
return MALLOC(n);

void operator delete[](void* ptr)
{
if(ptr)
FREE(ptr);

void* operator new(unsigned int size)
{
return MALLOC(size);

void operator delete(void * ptr)
{
FREE(ptr);

void* operator new[](unsigned int n)
{
return MALLOC(n);

void operator delete[](void* ptr)
{
if(ptr)
FREE(ptr);

Can I see appdefs.cpp, too? By the way, I use size_t instead of unsigned int; looks like you might want to try that, as suggested by the compiler...

Can I see appdefs.cpp, too? By the way, I use size_t instead of unsigned int; looks like you might want to try that, as suggested by the compiler...

the error
sC:\gnude/bin/arm-elf-ld: cannot find -lgcc
make: *** [TLogic.elf] Error 1
Plz help

the error
sC:\gnude/bin/arm-elf-ld: cannot find -lgcc
make: *** [TLogic.elf] Error 1
Plz help

Check the thread I linked to (edit: this one); this exact problem (and solution!) are contained in there :) Let me know how you get on!
Hope this helps,
Simon

Check the thread I linked to (edit: this one); this exact problem (and solution!) are contained in there :) Let me know how you get on!
Hope this helps,
Simon

simon but still i get the previous error plz tell me why that error occurs

simon but still i get the previous error plz tell me why that error occurs

Quote:Originally posted by badricool
simon but still i get the previous error plz tell me why that error occurs
Which error do you mean? If you mean the "operator new takes size_t as its first argument", I'll really need to see the code for appdefs.cpp. Did you change "unsigned int" to "size_t" like I suggested?
If you mean the -lgcc error, then the answer is in that thread I linked to; basically, you need to make sure that the
LIBDIRS
variable is set to include the path to Gnudes' libgcc.a file; on my system; this is
c:/Gnude/lib/gcc-lib/arm-elf/3.3.1
Does this directory exist on your system? Does it contain libgcc.a? If not, do a search for libgcc.a starting from your gnude directory.

Quote:Originally posted by badricool
simon but still i get the previous error plz tell me why that error occurs
Which error do you mean? If you mean the "operator new takes size_t as its first argument", I'll really need to see the code for appdefs.cpp. Did you change "unsigned int" to "size_t" like I suggested?
If you mean the -lgcc error, then the answer is in that thread I linked to; basically, you need to make sure that the
LIBDIRS
variable is set to include the path to Gnudes' libgcc.a file; on my system; this is
c:/Gnude/lib/gcc-lib/arm-elf/3.3.1
Does this directory exist on your system? Does it contain libgcc.a? If not, do a search for libgcc.a starting from your gnude directory.

Can u guide why this error occurs:
Plz plz this is very urgent
C:\gnude/lib/gcc-lib/arm-elf/3.3.1/libgcc.a(unwind-sjlj.o)(.text+0x444): In func
tion `_Unwind_SjLj_Resume_or_Rethrow':
../../gcc-3.3.1/gcc/unwind.inc:256: undefined reference to `abort'
make: *** [TLogicc.elf] Error 1

Can u guide why this error occurs:
Plz plz this is very urgent
C:\gnude/lib/gcc-lib/arm-elf/3.3.1/libgcc.a(unwind-sjlj.o)(.text+0x444): In func
tion `_Unwind_SjLj_Resume_or_Rethrow':
../../gcc-3.3.1/gcc/unwind.inc:256: undefined reference to `abort'
make: *** [TLogicc.elf] Error 1

Wow - deja vu!
Again, this is covered in the other thread; basically, you need to add -fno-exceptions to your list of compiler flags. Did the makefile I uploaded not include this setting? That's two people who have used it who have made the same mistake :confused:
Edit:
Nope, it's there alright - why did you remove it? :confused:

Wow - deja vu!
Again, this is covered in the other thread; basically, you need to add -fno-exceptions to your list of compiler flags. Did the makefile I uploaded not include this setting? That's two people who have used it who have made the same mistake :confused:
Edit:
Nope, it's there alright - why did you remove it? :confused:

Plz tell me what is this error
: undefined reference to `memcpy'
make: *** [TLogic.elf] Error 1
Plzzzzz

Plz tell me what is this error
: undefined reference to `memcpy'
make: *** [TLogic.elf] Error 1
Plzzzzz

That's a weird error that (I think) is caused by a bug in gcc. When I used gcc (I've now switched to ADS), I was unable to declare arrays like this:
ArrayType array[] = { item1, item2, item3};
Instead, I would have to do this:
ArrayType array[3];
array[0] = item1;
array[1] = item2;
array[2] = item3;
Have you defined any arrays using the above format i.e. explicitly stating the contents of an array, like {item1,item2,item3}?
Edit:
P.S.
If anyone has a better solution to this particular problem other than "don't define arrays in that manner", I'd like to hear about it :)

That's a weird error that (I think) is caused by a bug in gcc. When I used gcc (I've now switched to ADS), I was unable to declare arrays like this:
ArrayType array[] = { item1, item2, item3};
Instead, I would have to do this:
ArrayType array[3];
array[0] = item1;
array[1] = item2;
array[2] = item3;
Have you defined any arrays using the above format i.e. explicitly stating the contents of an array, like {item1,item2,item3}?
Edit:
P.S.
If anyone has a better solution to this particular problem other than "don't define arrays in that manner", I'd like to hear about it :)

Quote:That's a weird error that (I think) is caused by a bug in gcc. When I used gcc (I've now switched to ADS), I was unable to declare arrays like this: (...)
Weird, i don't have any pb, the following piece of code compiles perfectly using g++ under gnude:
typedef struct ArrayType_
{
int32 x,y;
ArrayType;
void test()
{
ArrayType item1 = { 0, 1 }, item2 = { 2, 3 };
ArrayType array[] = { item1, item2 };
ArrayType array2[] = { {4, 5}, {6, 7} };

/kUfa

Quote:That's a weird error that (I think) is caused by a bug in gcc. When I used gcc (I've now switched to ADS), I was unable to declare arrays like this: (...)
Weird, i don't have any pb, the following piece of code compiles perfectly using g++ under gnude:
typedef struct ArrayType_
{
int32 x,y;
ArrayType;
void test()
{
ArrayType item1 = { 0, 1 }, item2 = { 2, 3 };
ArrayType array[] = { item1, item2 };
ArrayType array2[] = { {4, 5}, {6, 7} };

/kUfa

hi
Kufa & simon can u tell me why that happens.Is becaz that the compiler problem or what is the lookaround for that
plz plz plz ASAP!

hi
Kufa & simon can u tell me why that happens.Is becaz that the compiler problem or what is the lookaround for that
plz plz plz ASAP!

Did you forgot to link with gccresolver.o ?
#include "AEEStdLib.h"
void *memcpy(void *s1, const void *s2, size_t n) {
return MEMCPY(s1, s2, n);

void *memset(void *s1, int c, size_t n) {
return MEMSET(s1, c, n);

/kUfa
PS: no private message to ask me to answer in a thread pliz

Did you forgot to link with gccresolver.o ?
#include "AEEStdLib.h"
void *memcpy(void *s1, const void *s2, size_t n) {
return MEMCPY(s1, s2, n);

void *memset(void *s1, int c, size_t n) {
return MEMSET(s1, c, n);

/kUfa
PS: no private message to ask me to answer in a thread pliz

I have also linked GccResolver but still throes this Error
I also compiled an small C program that was properly working while i complied with ADS but when i complied this in Gnude the mod is crashing in the device -- can u tell me why
Plz ASAP

I have also linked GccResolver but still throes this Error
I also compiled an small C program that was properly working while i complied with ADS but when i complied this in Gnude the mod is crashing in the device -- can u tell me why
Plz ASAP

> can u tell me why
Well, at least i can try to guess.. But check the other threads, you will find alot of informations
If the device crashed, it's probably your code :) Have you checked the map file? Did you use the right order for the linkage? Does your application consumes too much time? (i guess not if it's working with ads)
Check the other threads to find out good parameters for gcc/g++ under gnude.
/kUfa

> can u tell me why
Well, at least i can try to guess.. But check the other threads, you will find alot of informations
If the device crashed, it's probably your code :) Have you checked the map file? Did you use the right order for the linkage? Does your application consumes too much time? (i guess not if it's working with ads)
Check the other threads to find out good parameters for gcc/g++ under gnude.
/kUfa

Quote:Originally posted by kUfa
Weird, i don't have any pb, the following piece of code compiles perfectly using g++ under gnude:
typedef struct ArrayType_
{
int32 x,y;
ArrayType;
void test()
{
ArrayType item1 = { 0, 1 }, item2 = { 2, 3 };
ArrayType array[] = { item1, item2 };
ArrayType array2[] = { {4, 5}, {6, 7} };

/kUfa
Hi kUfa,
I don't have a snippet of code to show as an example, I'm afraid, but I found that explicitly defined arrays above a certain length (not even a particularly large length, either) caused this error; remove the definition, and it compiles fine; put it back in, and we get the memcpy compile error. It seems to be as regular as clockwork.
Also, it wasn't just one isolated instance; as my game progressed, I tried putting a completely different explicit array in a completely different place: identical result; what compiled perfectly well before then gave the error above.
Has noone else seen this "feature"?
Edit: I don't have gnude installed anymore, but maybe you can try this experiment: increase the length of your array and see if you can trigger a compile error. I'd be suprised if it didn't happen before, oh, let's say, 50 elements...The original type that killed mine was "byte", so maybe try with a byte array instead...I'm sure I'm not the only one who this has happened to! :)

Quote:Originally posted by kUfa
Weird, i don't have any pb, the following piece of code compiles perfectly using g++ under gnude:
typedef struct ArrayType_
{
int32 x,y;
ArrayType;
void test()
{
ArrayType item1 = { 0, 1 }, item2 = { 2, 3 };
ArrayType array[] = { item1, item2 };
ArrayType array2[] = { {4, 5}, {6, 7} };

/kUfa
Hi kUfa,
I don't have a snippet of code to show as an example, I'm afraid, but I found that explicitly defined arrays above a certain length (not even a particularly large length, either) caused this error; remove the definition, and it compiles fine; put it back in, and we get the memcpy compile error. It seems to be as regular as clockwork.
Also, it wasn't just one isolated instance; as my game progressed, I tried putting a completely different explicit array in a completely different place: identical result; what compiled perfectly well before then gave the error above.
Has noone else seen this "feature"?
Edit: I don't have gnude installed anymore, but maybe you can try this experiment: increase the length of your array and see if you can trigger a compile error. I'd be suprised if it didn't happen before, oh, let's say, 50 elements...The original type that killed mine was "byte", so maybe try with a byte array instead...I'm sure I'm not the only one who this has happened to! :)

Hmm...
Ok, can you clarify a bit: when do you do this, do you get a compile error, or a link error? If it's a link error, just triple check you have gcc resolver.o somewhere (compiled in C)
/kUfa

Hmm...
Ok, can you clarify a bit: when do you do this, do you get a compile error, or a link error? If it's a link error, just triple check you have gcc resolver.o somewhere (compiled in C)
/kUfa

Quote:Originally posted by kUfa
Hmm...
Ok, can you clarify a bit: when do you do this, do you get a compile error, or a link error? If it's a link error, just triple check you have gcc resolver.o somewhere (compiled in C)
/kUfa
Well, it was quite a long time ago, I'm afraid...I can't really remember :(. I guess it's possible that I didn't include GCCResolver, but I'm almost positive I did, as it was required in order to fix a prior problem. I should point out that at the time of trying the second experiment (i.e. explicitly defining another array), the program was already quite large and complex, and it seems odd that it could have gotten to that stage without GCCResolver...But you're probably right :)

Quote:Originally posted by kUfa
Hmm...
Ok, can you clarify a bit: when do you do this, do you get a compile error, or a link error? If it's a link error, just triple check you have gcc resolver.o somewhere (compiled in C)
/kUfa
Well, it was quite a long time ago, I'm afraid...I can't really remember :(. I guess it's possible that I didn't include GCCResolver, but I'm almost positive I did, as it was required in order to fix a prior problem. I should point out that at the time of trying the second experiment (i.e. explicitly defining another array), the program was already quite large and complex, and it seems odd that it could have gotten to that stage without GCCResolver...But you're probably right :)

ifndef TARGET
TARGET = myApp
endif
EXETYPE = elf
BINARY = bin
MODULE = mod
ifndef BREW_VER
BREW_VER = 1.1
endif
#-----------------------------------------------------------
# Additional objects apart from $(TARGET).o
#-----------------------------------------------------------
ADD_OBJS = GCCResolver.o
#-----------------------------------------------------------------------
# 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_OBBJS= AEEModGen.o AEEAppGen.o $(ADD_OBJS) $(TARGET).o
# this is commented to test for maxfile cnt
#-----------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a dynamic app.
#-----------------------------------------------------------------------
DEFINES = -DDYNAMIC_APP
#-----------------------------------------------------------------------
# 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)
#-----------------------------------------------------------------------
ifndef GCCHOMEPATH
GCCHOMEPATH = c:/gnude
endif
GCCBINPATH = $(GCCHOMEPATH)/bin
ELF2MODTOOLPATH = $(GCCHOMEPATH)
#-----------------------------------------------------------
# Fix the path here to location of AEEAppGen.c and AEEModGen.c
#-----------------------------------------------------------
AEESRCPATH = $(GCCHOMEPATH)/$(BREW_VER)/src
#-----------------------------------------------------------
# Fix the path here to location of BREW header files
#-----------------------------------------------------------
AEEINCPATH = $(GCCHOMEPATH)/$(BREW_VER)/inc
#This is commented for testing MaxfileCnt
GCC = $(GCCBINPATH)/arm-elf-gcc.exe
#GCC = $(GCCBINPATH)/arm-elf-g++.exe
LD = $(GCCBINPATH)/arm-elf-ld.exe
ELF2MODTOOL = $(ELF2MODTOOLPATH)/BREWelf2mod.exe
#-----------------------------------------------------------------------
# Compiler optimization options
# -O0 disables compiler optimizations. Other options probably work as
# well. Set to taste.
#-----------------------------------------------------------------------
OPT = -O2
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
# 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\include
#INC = -I$(AEEINCPATH) -I$(GCCHOMEPATH)\lib\gcc-lib\arm-elf\include -I$(GCCHOMEPATH)\arm-elf\include
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a
#-----------------------------------------------------------------------
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1
#LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
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 = -Wall $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#CFLAGS = $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#-----------------------------------------------------------------------
# Linker Options
# -o sets the output filename
#-----------------------------------------------------------------------
LINK_CMD = -Ttext 0 --emit-relocs -entry AEEMod_Load -o
LIBS = -lgcc
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
LDFLAGS = $(LIBDIRS)
#-----------------------------------------------------------------------
# Default target
#-----------------------------------------------------------------------
default: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
$(TARGET).$(EXETYPE) : $(APP_OBJS)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(LIBS) $(LINK_ORDER)
#-----------------------------------------------------------------------
# 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
#$(TARGET).o: $(TARGET).cpp
# $(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cpp
AEEAppGen.o:
$(GCC) $(CFLAGS) -o AEEAppGen.o $(AEESRCPATH)/AEEAppGen.c
AEEModGen.o:
$(GCC) $(CFLAGS) -o AEEModGen.o $(AEESRCPATH)/AEEModGen.c
GCCResolver.o:
$(GCC) $(CFLAGS) -o GCCResolver.o $(GCCHOMEPATH)/GCCResolver.c
Max.o:
$(GCC) $(CFLAGS) -o Max.o ./Max.c

ifndef TARGET
TARGET = myApp
endif
EXETYPE = elf
BINARY = bin
MODULE = mod
ifndef BREW_VER
BREW_VER = 1.1
endif
#-----------------------------------------------------------
# Additional objects apart from $(TARGET).o
#-----------------------------------------------------------
ADD_OBJS = GCCResolver.o
#-----------------------------------------------------------------------
# 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_OBBJS= AEEModGen.o AEEAppGen.o $(ADD_OBJS) $(TARGET).o
# this is commented to test for maxfile cnt
#-----------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a dynamic app.
#-----------------------------------------------------------------------
DEFINES = -DDYNAMIC_APP
#-----------------------------------------------------------------------
# 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)
#-----------------------------------------------------------------------
ifndef GCCHOMEPATH
GCCHOMEPATH = c:/gnude
endif
GCCBINPATH = $(GCCHOMEPATH)/bin
ELF2MODTOOLPATH = $(GCCHOMEPATH)
#-----------------------------------------------------------
# Fix the path here to location of AEEAppGen.c and AEEModGen.c
#-----------------------------------------------------------
AEESRCPATH = $(GCCHOMEPATH)/$(BREW_VER)/src
#-----------------------------------------------------------
# Fix the path here to location of BREW header files
#-----------------------------------------------------------
AEEINCPATH = $(GCCHOMEPATH)/$(BREW_VER)/inc
#This is commented for testing MaxfileCnt
GCC = $(GCCBINPATH)/arm-elf-gcc.exe
#GCC = $(GCCBINPATH)/arm-elf-g++.exe
LD = $(GCCBINPATH)/arm-elf-ld.exe
ELF2MODTOOL = $(ELF2MODTOOLPATH)/BREWelf2mod.exe
#-----------------------------------------------------------------------
# Compiler optimization options
# -O0 disables compiler optimizations. Other options probably work as
# well. Set to taste.
#-----------------------------------------------------------------------
OPT = -O2
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
# 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\include
#INC = -I$(AEEINCPATH) -I$(GCCHOMEPATH)\lib\gcc-lib\arm-elf\include -I$(GCCHOMEPATH)\arm-elf\include
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a
#-----------------------------------------------------------------------
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1
#LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
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 = -Wall $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#CFLAGS = $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#-----------------------------------------------------------------------
# Linker Options
# -o sets the output filename
#-----------------------------------------------------------------------
LINK_CMD = -Ttext 0 --emit-relocs -entry AEEMod_Load -o
LIBS = -lgcc
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
LDFLAGS = $(LIBDIRS)
#-----------------------------------------------------------------------
# Default target
#-----------------------------------------------------------------------
default: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
$(TARGET).$(EXETYPE) : $(APP_OBJS)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(LIBS) $(LINK_ORDER)
#-----------------------------------------------------------------------
# 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
#$(TARGET).o: $(TARGET).cpp
# $(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cpp
AEEAppGen.o:
$(GCC) $(CFLAGS) -o AEEAppGen.o $(AEESRCPATH)/AEEAppGen.c
AEEModGen.o:
$(GCC) $(CFLAGS) -o AEEModGen.o $(AEESRCPATH)/AEEModGen.c
GCCResolver.o:
$(GCC) $(CFLAGS) -o GCCResolver.o $(GCCHOMEPATH)/GCCResolver.c
Max.o:
$(GCC) $(CFLAGS) -o Max.o ./Max.c

$(TARGET).o: $(TARGET).c
You state that myApp.o depends on myApp.c, but don't give a rule for building it; I'm guessing make is using some erroneous default rule to compile it and this is what is causing problems (although I wil state again that I know almost nothing about make :p).
Add a line underneath it:
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET)
(probably with a tab in front)

$(TARGET).o: $(TARGET).c
You state that myApp.o depends on myApp.c, but don't give a rule for building it; I'm guessing make is using some erroneous default rule to compile it and this is what is causing problems (although I wil state again that I know almost nothing about make :p).
Add a line underneath it:
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET)
(probably with a tab in front)

simon thanks a lot but how to solve this
Plz help me
Badri

simon thanks a lot but how to solve this
Plz help me
Badri

Did you try what I just suggested? If so, what went wrong?

Did you try what I just suggested? If so, what went wrong?

thanks a lot simon but still the mod is crashing --plz help me simon

thanks a lot simon but still the mod is crashing --plz help me simon

Have you tried to put several DBGPRINTF to see where it crashes?
/kUfa

Have you tried to put several DBGPRINTF to see where it crashes?
/kUfa

Well, it could be virtually anything at all :(. Post all of the code, and I'll look through it when I get time.
Quote:Originally posted by kUfa
Have you tried to put several DBGPRINTF to see where it crashes?
/kUfa
This is excellent advice; I'd be lost without the BREW logger :)

Well, it could be virtually anything at all :(. Post all of the code, and I'll look through it when I get time.
Quote:Originally posted by kUfa
Have you tried to put several DBGPRINTF to see where it crashes?
/kUfa
This is excellent advice; I'd be lost without the BREW logger :)

hey the mod crashes when i stsrt it itself but the dll are working fine .When i used ADS it was working fine....
Plz tell me an lookaround for this
ASAP!!!!!!!!!!

hey the mod crashes when i stsrt it itself but the dll are working fine .When i used ADS it was working fine....
Plz tell me an lookaround for this
ASAP!!!!!!!!!!

Hi badricool,
It is not at all uncommon for a .dll to work perfectly and a .mod to fail. There are two main causes of this:
1) Your code is at fault;
2) The make process is at fault.
It is almost 100% always Number 1 :) That's why I keep on asking you to post the code; there are uncountable possible causes for what you have described, and we simply cannot know what they are unless you post all code and resources you use.
Also, try kUfa's suggestion of using DBGPRINTF to see how far long your code gets.
Hope this helps,
Simon
Edit:
Incidentally; are you getting any errors/ warnings when you compile? If so, post them.

Hi badricool,
It is not at all uncommon for a .dll to work perfectly and a .mod to fail. There are two main causes of this:
1) Your code is at fault;
2) The make process is at fault.
It is almost 100% always Number 1 :) That's why I keep on asking you to post the code; there are uncountable possible causes for what you have described, and we simply cannot know what they are unless you post all code and resources you use.
Also, try kUfa's suggestion of using DBGPRINTF to see how far long your code gets.
Hope this helps,
Simon
Edit:
Incidentally; are you getting any errors/ warnings when you compile? If so, post them.

Quote:Originally posted by badricool
I have also linked GccResolver but still throes this Error
I also compiled an small C program that was properly working while i complied with ADS but when i complied this in Gnude the mod is crashing in the device -- can u tell me why
Plz ASAP
why dont you attach (use the attach file field) the file that contains the source for this small C program and we can look at it and possibly help you with your problem..
Otherwise, as BOTH kufa and simon said, put DBGPRINTF statements in your code and use the BrewLogger to find out how far your app is getting before crashing..
Its difficult for people to help you if you dont provide more information.

Quote:Originally posted by badricool
I have also linked GccResolver but still throes this Error
I also compiled an small C program that was properly working while i complied with ADS but when i complied this in Gnude the mod is crashing in the device -- can u tell me why
Plz ASAP
why dont you attach (use the attach file field) the file that contains the source for this small C program and we can look at it and possibly help you with your problem..
Otherwise, as BOTH kufa and simon said, put DBGPRINTF statements in your code and use the BrewLogger to find out how far your app is getting before crashing..
Its difficult for people to help you if you dont provide more information.

First of all, typo error: APP_OBBJS
Then you still haven't answered to my question, did you check the map file, maybe gcc created some static data
Quote:ASAP!!!!!!!!!!
Ppl on the forum are here to help you if they can and if they want to. Don't except anyone to do your job.
/kUfa

First of all, typo error: APP_OBBJS
Then you still haven't answered to my question, did you check the map file, maybe gcc created some static data
Quote:ASAP!!!!!!!!!!
Ppl on the forum are here to help you if they can and if they want to. Don't except anyone to do your job.
/kUfa

The App is working thank u gys

The App is working thank u gys

Quote:Originally posted by badricool
The App is working thank u gys
Glad to hear it :D. Just for the record, what turned out to be the problem, and how did you fix it? This information might help other people who are in a similar situation to yours...:)
Edit:
I'm guessing that eagle-eyed kuFa's typo-spotting solved the problem :)

Quote:Originally posted by badricool
The App is working thank u gys
Glad to hear it :D. Just for the record, what turned out to be the problem, and how did you fix it? This information might help other people who are in a similar situation to yours...:)
Edit:
I'm guessing that eagle-eyed kuFa's typo-spotting solved the problem :)

Can u just help me simon it still shows the link error!!!!

Can u just help me simon it still shows the link error!!!!

Which link error? In future, please provide full information in every post - the guys on this board are smart, but we're not mindreaders! ;)

Which link error? In future, please provide full information in every post - the guys on this board are smart, but we're not mindreaders! ;)

#============================================================================
# Name:
# #
# Description:
# Makefile to build the $(TARGET) downloadable module.
#
# The following targets are available in this makefile:
#
# all - make .elf and .mod image files (default)
# clean - delete object directory and image files
#
# The above targets can be made with the following command:
#
#
# Assumptions:
# 1. cygwin is installed on your machine and is in the path.
# 2. GCCHOMEPATH points to location where GNU tools are installed.
#
# Notes:
# 1. You might need to modify the GCCHOMEPATH, GCCBINPATH, ELF2MODTOOLPATH
# and LIBDIRS variable below.
# 2. While building the application using this make file, the following
# warnings may be received. They can be safely ignored:
# "Warning: _divsi3.o does not support interworking, whereas .elf does not"
# "Warning: _dvmd_tls.o does not support interworking, whereas .elf does not"
#
# Copyright © 2000-2003 QUALCOMM Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#----------------------------------------------------------------------------
#-----------------------------------------------------------------------
# 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 = myApp
endif
EXETYPE = elf
BINARY = bin
MODULE = mod
ifndef BREW_VER
BREW_VER = 1.1
endif
#-----------------------------------------------------------
# Additional objects apart from $(TARGET).o
#-----------------------------------------------------------
ADD_OBJS = GCCResolver.o
#-----------------------------------------------------------------------
# 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
# this is commented to test for maxfile cnt
APP_OBJS = AEEModGen.o AEEAppGen.o AppMain.o bmpUtils.o InFormationPlay.o $(ADD_OBJS) $(TARGET).o
#-----------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a dynamic app.
#-----------------------------------------------------------------------
DEFINES = -DDYNAMIC_APP
#-----------------------------------------------------------------------
# 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)
#-----------------------------------------------------------------------
ifndef GCCHOMEPATH
GCCHOMEPATH = c:/gnude
endif
GCCBINPATH = $(GCCHOMEPATH)/bin
ELF2MODTOOLPATH = $(GCCHOMEPATH)
#-----------------------------------------------------------
# Fix the path here to location of AEEAppGen.c and AEEModGen.c
#-----------------------------------------------------------
AEESRCPATH = $(GCCHOMEPATH)/$(BREW_VER)/src
#-----------------------------------------------------------
# Fix the path here to location of BREW header files
#-----------------------------------------------------------
AEEINCPATH = $(GCCHOMEPATH)/$(BREW_VER)/inc
#This is commented for testing MaxfileCnt
#GCC = $(GCCBINPATH)/arm-elf-gcc.exe
GCC = $(GCCBINPATH)/arm-elf-g++.exe
LD = $(GCCBINPATH)/arm-elf-ld.exe
ELF2MODTOOL = $(ELF2MODTOOLPATH)/BREWelf2mod.exe
#-----------------------------------------------------------------------
# Compiler optimization options
# -O0 disables compiler optimizations. Other options probably work as
# well. Set to taste.
#-----------------------------------------------------------------------
OPT = -O2
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
# 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\include
#INC = -I$(AEEINCPATH) -I$(GCCHOMEPATH)\lib\gcc-lib\arm-elf\include -I$(GCCHOMEPATH)\arm-elf\include
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a
#-----------------------------------------------------------------------
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1
#LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
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 = -Wall $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#CFLAGS = $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#-----------------------------------------------------------------------
# Linker Options
# -o sets the output filename
#-----------------------------------------------------------------------
LINK_CMD = -Ttext 0 --emit-relocs -entry AEEMod_Load -o
LIBS = -lgcc
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
LDFLAGS = $(LIBDIRS)
#-----------------------------------------------------------------------
# Default target
#-----------------------------------------------------------------------
default: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
$(TARGET).$(EXETYPE) : $(APP_OBJS)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(LIBS) $(LINK_ORDER)
#-----------------------------------------------------------------------
# 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
# $(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET)
$(TARGET).o: $(TARGET).cpp
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cpp
AEEAppGen.o:
$(GCC) $(CFLAGS) -o AEEAppGen.o $(AEESRCPATH)/AEEAppGen.c
AEEModGen.o:
$(GCC) $(CFLAGS) -o AEEModGen.o $(AEESRCPATH)/AEEModGen.c
GCCResolver.o:
$(GCC) $(CFLAGS) -o GCCResolver.o $(GCCHOMEPATH)/GCCResolver.c
%.o : %.cpp
$(GCC) $(CFLAGS) -o $*.o $*.cpp
*********************************************
Here is the link error i get plz help me ASAP:!!!!!!
:368: undefined reference to `memcpy'
make: *** [TLogic.elf] Error 1
*********************************************

#============================================================================
# Name:
# #
# Description:
# Makefile to build the $(TARGET) downloadable module.
#
# The following targets are available in this makefile:
#
# all - make .elf and .mod image files (default)
# clean - delete object directory and image files
#
# The above targets can be made with the following command:
#
#
# Assumptions:
# 1. cygwin is installed on your machine and is in the path.
# 2. GCCHOMEPATH points to location where GNU tools are installed.
#
# Notes:
# 1. You might need to modify the GCCHOMEPATH, GCCBINPATH, ELF2MODTOOLPATH
# and LIBDIRS variable below.
# 2. While building the application using this make file, the following
# warnings may be received. They can be safely ignored:
# "Warning: _divsi3.o does not support interworking, whereas .elf does not"
# "Warning: _dvmd_tls.o does not support interworking, whereas .elf does not"
#
# Copyright © 2000-2003 QUALCOMM Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#----------------------------------------------------------------------------
#-----------------------------------------------------------------------
# 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 = myApp
endif
EXETYPE = elf
BINARY = bin
MODULE = mod
ifndef BREW_VER
BREW_VER = 1.1
endif
#-----------------------------------------------------------
# Additional objects apart from $(TARGET).o
#-----------------------------------------------------------
ADD_OBJS = GCCResolver.o
#-----------------------------------------------------------------------
# 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
# this is commented to test for maxfile cnt
APP_OBJS = AEEModGen.o AEEAppGen.o AppMain.o bmpUtils.o InFormationPlay.o $(ADD_OBJS) $(TARGET).o
#-----------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a dynamic app.
#-----------------------------------------------------------------------
DEFINES = -DDYNAMIC_APP
#-----------------------------------------------------------------------
# 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)
#-----------------------------------------------------------------------
ifndef GCCHOMEPATH
GCCHOMEPATH = c:/gnude
endif
GCCBINPATH = $(GCCHOMEPATH)/bin
ELF2MODTOOLPATH = $(GCCHOMEPATH)
#-----------------------------------------------------------
# Fix the path here to location of AEEAppGen.c and AEEModGen.c
#-----------------------------------------------------------
AEESRCPATH = $(GCCHOMEPATH)/$(BREW_VER)/src
#-----------------------------------------------------------
# Fix the path here to location of BREW header files
#-----------------------------------------------------------
AEEINCPATH = $(GCCHOMEPATH)/$(BREW_VER)/inc
#This is commented for testing MaxfileCnt
#GCC = $(GCCBINPATH)/arm-elf-gcc.exe
GCC = $(GCCBINPATH)/arm-elf-g++.exe
LD = $(GCCBINPATH)/arm-elf-ld.exe
ELF2MODTOOL = $(ELF2MODTOOLPATH)/BREWelf2mod.exe
#-----------------------------------------------------------------------
# Compiler optimization options
# -O0 disables compiler optimizations. Other options probably work as
# well. Set to taste.
#-----------------------------------------------------------------------
OPT = -O2
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
# 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\include
#INC = -I$(AEEINCPATH) -I$(GCCHOMEPATH)\lib\gcc-lib\arm-elf\include -I$(GCCHOMEPATH)\arm-elf\include
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a
#-----------------------------------------------------------------------
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1
#LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3
#-----------------------------------------------------------------------
# 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
#-----------------------------------------------------------------------
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 = -Wall $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#CFLAGS = $(CFLAGS0) $(INC) $(OPT) -fno-exceptions
#-----------------------------------------------------------------------
# Linker Options
# -o sets the output filename
#-----------------------------------------------------------------------
LINK_CMD = -Ttext 0 --emit-relocs -entry AEEMod_Load -o
LIBS = -lgcc
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
LDFLAGS = $(LIBDIRS)
#-----------------------------------------------------------------------
# Default target
#-----------------------------------------------------------------------
default: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
$(TARGET).$(EXETYPE) : $(APP_OBJS)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(LIBS) $(LINK_ORDER)
#-----------------------------------------------------------------------
# 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
# $(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET)
$(TARGET).o: $(TARGET).cpp
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cpp
AEEAppGen.o:
$(GCC) $(CFLAGS) -o AEEAppGen.o $(AEESRCPATH)/AEEAppGen.c
AEEModGen.o:
$(GCC) $(CFLAGS) -o AEEModGen.o $(AEESRCPATH)/AEEModGen.c
GCCResolver.o:
$(GCC) $(CFLAGS) -o GCCResolver.o $(GCCHOMEPATH)/GCCResolver.c
%.o : %.cpp
$(GCC) $(CFLAGS) -o $*.o $*.cpp
*********************************************
Here is the link error i get plz help me ASAP:!!!!!!
:368: undefined reference to `memcpy'
make: *** [TLogic.elf] Error 1
*********************************************

As I said, I don't know what causes that error; let me ask (again!) - do you explicitly define any array contents anywhere in your code?

As I said, I don't know what causes that error; let me ask (again!) - do you explicitly define any array contents anywhere in your code?

Array contents are nothing to do, he'd have the same by just calling the memcpy by hand (he can do so)
I think (not sure) it's because you are using g++ instead of gcc, so your gccresolver.o will contain c++ headers. Use gcc for this one, or use extern "C" to see if it makes any change.
/kUfa

Array contents are nothing to do, he'd have the same by just calling the memcpy by hand (he can do so)
I think (not sure) it's because you are using g++ instead of gcc, so your gccresolver.o will contain c++ headers. Use gcc for this one, or use extern "C" to see if it makes any change.
/kUfa

Hey still i get one more link error
I changed now to GCC from G++ now i get an different eror
plz help me :
********************************************
Configuration.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
------------------------------------
*********************************************:confused:

Hey still i get one more link error
I changed now to GCC from G++ now i get an different eror
plz help me :
********************************************
Configuration.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
------------------------------------
*********************************************:confused:

Quote:Originally posted by badricool
Hey still i get one more link error
I changed now to GCC from G++ now i get an different eror
plz help me :
********************************************
Configuration.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
------------------------------------
*********************************************:confused:
I don't know much about GNU compilation tools, but is GCC even capable of handling C++? I'm guessing no. Is this the C++ thing you are trying to compile? The vtable thing suggests to me that indeed it is, and indeed no GCC can't :)
Quote:Originally posted by kUfa
Array contents are nothing to do, he'd have the same by just calling the memcpy by hand (he can do so)
I think (not sure) it's because you are using g++ instead of gcc, so your gccresolver.o will contain c++ headers. Use gcc for this one, or use extern "C" to see if it makes any change.
/kUfa
I'll bow to your judgement on this one, Guru ;) But the array thing definitely triggered the compiler error, with 100% reliability. Very odd indeed :confused:

Quote:Originally posted by badricool
Hey still i get one more link error
I changed now to GCC from G++ now i get an different eror
plz help me :
********************************************
Configuration.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
------------------------------------
*********************************************:confused:
I don't know much about GNU compilation tools, but is GCC even capable of handling C++? I'm guessing no. Is this the C++ thing you are trying to compile? The vtable thing suggests to me that indeed it is, and indeed no GCC can't :)
Quote:Originally posted by kUfa
Array contents are nothing to do, he'd have the same by just calling the memcpy by hand (he can do so)
I think (not sure) it's because you are using g++ instead of gcc, so your gccresolver.o will contain c++ headers. Use gcc for this one, or use extern "C" to see if it makes any change.
/kUfa
I'll bow to your judgement on this one, Guru ;) But the array thing definitely triggered the compiler error, with 100% reliability. Very odd indeed :confused:

if kufa or u could tell me an lookaround for this it would be an great help

if kufa or u could tell me an lookaround for this it would be an great help

We can't help you if you don't post code. Or answer our questions :)

We can't help you if you don't post code. Or answer our questions :)

CTLp::CTlLp()
{
pModuleList = pListTail = NULL;
}
Plz help

CTLp::CTlLp()
{
pModuleList = pListTail = NULL;
}
Plz help

Quote:Originally posted by badricool
CTLp::CTlLp()
{
pModuleList = pListTail = NULL;
}
Plz help
Which error are you getting? When reporting an error, please always do the following in future:
1) Give the exact error message as reported by the compiler/ VC++ - state whether it is a compiler or a runtime error.
2) Give the snippet of code containing, at the very least, the line where the error occurs.

Quote:Originally posted by badricool
CTLp::CTlLp()
{
pModuleList = pListTail = NULL;
}
Plz help
Which error are you getting? When reporting an error, please always do the following in future:
1) Give the exact error message as reported by the compiler/ VC++ - state whether it is a compiler or a runtime error.
2) Give the snippet of code containing, at the very least, the line where the error occurs.

thanks simon but this is the error i get and i have posted the code of in earlierpost
****************************************************
The error :
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0):/cygdrive/e/4/CTLp.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
****************************************************
Plz help ASAP

thanks simon but this is the error i get and i have posted the code of in earlierpost
****************************************************
The error :
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0):/cygdrive/e/4/CTLp.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
****************************************************
Plz help ASAP

And I asked you the question: is this a c++ project you are compiling, using gcc? If so, I'm not convinced it will work at all; I think (although as I said, I'm not really familiar with the GNU compilation tools, so please correct me if I'm wrong) that gcc only works with C, not with C++.

And I asked you the question: is this a c++ project you are compiling, using gcc? If so, I'm not convinced it will work at all; I think (although as I said, I'm not really familiar with the GNU compilation tools, so please correct me if I'm wrong) that gcc only works with C, not with C++.

yes it C++ project simon
Thanks a lot simon .............
I'am still worried what shld i do.I think Kufa shld reply to this???

yes it C++ project simon
Thanks a lot simon .............
I'am still worried what shld i do.I think Kufa shld reply to this???

Ok. kuFa knows way more about all this than I do, and states that this isn't causing the problem, but just out of curiosity - do you explicitly define any array contents anywhere in your code?
(.e.g ArrayType array[] = {item1,item2,item3}; rather than just ArrayType array[3]; )

Ok. kuFa knows way more about all this than I do, and states that this isn't causing the problem, but just out of curiosity - do you explicitly define any array contents anywhere in your code?
(.e.g ArrayType array[] = {item1,item2,item3}; rather than just ArrayType array[3]; )

yes simon i use an big array ....Is that causing the problem
Simon

yes simon i use an big array ....Is that causing the problem
Simon

Quote:I changed now to GCC from G++ now i get an different eror
That's not what i said...
Basically, your c++ code must be compiled using g++, your c code using gcc. But in the latest makefile your posted:
Quote:GCC = $(GCCBINPATH)/arm-elf-g++.exe
So you were only using g++...
Therefore, when GccResolver.c is compiled, the function signatures will be different, ie it won't be _memcpy but something like _mR0_memcpy or whatever (depends on the compiler and platform), so you obviously get a link error.
A way to solve it and only using g++:
extern "C" {
#include "AEEStdLib.h"
void *memcpy(void *s1, const void *s2, size_t n) {
return MEMCPY(s1, s2, n);

void *memset(void *s1, int c, size_t n) {
return MEMSET(s1, c, n);

};
simon: yes, sometimes. Well, rarely in fact. I mostly use static const int8 frameSeq[] = { 0, 1, 2, 3 }; stuffs, but i also use things very similar to your example, when i try to detect the device for instance.
But i mostly prefer to save stack mem, and using as less static const as possible, so i dont do that very often ;)
/kUfa

Quote:I changed now to GCC from G++ now i get an different eror
That's not what i said...
Basically, your c++ code must be compiled using g++, your c code using gcc. But in the latest makefile your posted:
Quote:GCC = $(GCCBINPATH)/arm-elf-g++.exe
So you were only using g++...
Therefore, when GccResolver.c is compiled, the function signatures will be different, ie it won't be _memcpy but something like _mR0_memcpy or whatever (depends on the compiler and platform), so you obviously get a link error.
A way to solve it and only using g++:
extern "C" {
#include "AEEStdLib.h"
void *memcpy(void *s1, const void *s2, size_t n) {
return MEMCPY(s1, s2, n);

void *memset(void *s1, int c, size_t n) {
return MEMSET(s1, c, n);

};
simon: yes, sometimes. Well, rarely in fact. I mostly use static const int8 frameSeq[] = { 0, 1, 2, 3 }; stuffs, but i also use things very similar to your example, when i try to detect the device for instance.
But i mostly prefer to save stack mem, and using as less static const as possible, so i dont do that very often ;)
/kUfa

Quote:Originally posted by kUfa
But i mostly prefer to save stack mem, and using as less static const as possible, so i dont do that very often ;)
/kUfa
Hear, hear! Apparently, some of the early devices had just 500 bytes(!) of stack - hard to believe! :o
Edit:
badricool: try kuFa's fix, first as see if that solves your problem (which I imagine it will :)). Just in case it doesn't, try temporarilyl removing all array definitions and see if you can get it to compile then...

Quote:Originally posted by kUfa
But i mostly prefer to save stack mem, and using as less static const as possible, so i dont do that very often ;)
/kUfa
Hear, hear! Apparently, some of the early devices had just 500 bytes(!) of stack - hard to believe! :o
Edit:
badricool: try kuFa's fix, first as see if that solves your problem (which I imagine it will :)). Just in case it doesn't, try temporarilyl removing all array definitions and see if you can get it to compile then...

To clarify a bit what i think:
- you are never using memcpy explicitely
- you are using big arrays
- you are using -O2 compile option
So for example imagine we have this code:
static const int16 test_len = 3;
struct foo
{
int8 bar[ test_len ];
;
void test()
{
struct foo a;
struct foo b;
a = b;

So at the " a = b " line, the compiler will optimise it so it does not need to use memcpy for 3 elements. But if test_len is bigger, it may use memcpy..
/kUfa

To clarify a bit what i think:
- you are never using memcpy explicitely
- you are using big arrays
- you are using -O2 compile option
So for example imagine we have this code:
static const int16 test_len = 3;
struct foo
{
int8 bar[ test_len ];
;
void test()
{
struct foo a;
struct foo b;
a = b;

So at the " a = b " line, the compiler will optimise it so it does not need to use memcpy for 3 elements. But if test_len is bigger, it may use memcpy..
/kUfa

Quote:Originally posted by kUfa
To clarify a bit what i think:
- you are never using memcpy explicitely
- you are using big arrays
- you are using -O2 compile option
So for example imagine we have this code:
static const int16 test_len = 3;
struct foo
{
int8 bar[ test_len ];
;
void test()
{
struct foo a;
struct foo b;
a = b;

So at the " a = b " line, the compiler will optimise it so it does not need to use memcpy for 3 elements. But if test_len is bigger, it may use memcpy..
/kUfa
Sounds plausible to me, though the error only occurred if I actually explicitly defined the array contents; i.e. a line like
ArrayType array[1000];
would be fine, whereas a explicitly defined array (sorry, I don't know the precise terminology) would fail at a tiny fraction of that size.
But again, you are most certainly right that it is some kind of compiler optimisation :)

Quote:Originally posted by kUfa
To clarify a bit what i think:
- you are never using memcpy explicitely
- you are using big arrays
- you are using -O2 compile option
So for example imagine we have this code:
static const int16 test_len = 3;
struct foo
{
int8 bar[ test_len ];
;
void test()
{
struct foo a;
struct foo b;
a = b;

So at the " a = b " line, the compiler will optimise it so it does not need to use memcpy for 3 elements. But if test_len is bigger, it may use memcpy..
/kUfa
Sounds plausible to me, though the error only occurred if I actually explicitly defined the array contents; i.e. a line like
ArrayType array[1000];
would be fine, whereas a explicitly defined array (sorry, I don't know the precise terminology) would fail at a tiny fraction of that size.
But again, you are most certainly right that it is some kind of compiler optimisation :)

I resolved that error by using Extern
But i get an error like this :
Plz tell hoe to solve this Kufa Plz plz plz ASAP
CTLp.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1

I resolved that error by using Extern
But i get an error like this :
Plz tell hoe to solve this Kufa Plz plz plz ASAP
CTLp.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1

Quote:Originally posted by badricool
I resolved that error by using Extern
But i get an error like this :
Plz tell hoe to solve this Kufa Plz plz plz ASAP
CTLp.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
Hmmm...let me just check that you are no longer using gcc to compile C++ code? That error gives every indication that this is what you are doing, when kUfa told you not to :)

Quote:Originally posted by badricool
I resolved that error by using Extern
But i get an error like this :
Plz tell hoe to solve this Kufa Plz plz plz ASAP
CTLp.cpp:12: undefined reference to `vtable for __cxxabiv
1::__class_type_info'
make: *** [TLogic.elf] Error 1
Hmmm...let me just check that you are no longer using gcc to compile C++ code? That error gives every indication that this is what you are doing, when kUfa told you not to :)

I'am onky using G++ now

I'am onky using G++ now

If you are using C++ everywhere, in ALL your .hpp, suround ALL your BREW includes with a extern "C":
// blablabla
extern "C" {
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEStdLib.h" // AEE StdLib services
#include "AEEGraphics.h"
#include "AEELicense.h"
#include "AEEHeap.h"
;
Otherwise all the brew functions will use the c++ definitions..

If you are using C++ everywhere, in ALL your .hpp, suround ALL your BREW includes with a extern "C":
// blablabla
extern "C" {
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEStdLib.h" // AEE StdLib services
#include "AEEGraphics.h"
#include "AEELicense.h"
#include "AEEHeap.h"
;
Otherwise all the brew functions will use the c++ definitions..

I would also recommend to use gcc for the two default brew files..

I would also recommend to use gcc for the two default brew files..

am getting the following error pls help me if u have the sol fo it
Splasher.o(.text+0x1e4): In function `Splasher::Activate()':
: undefined reference to `operator new(unsigned long)'
Splasher.o(.text+0x2e4): In function `Splasher::Deactivate()':
: undefined reference to `operator delete(void*)'
Splasher.o(.gnu.linkonce.r._ZTI8Splasher+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
Configuration.o(.text+0x254): In function `CConfiguration::~CConfiguration()':
: undefined reference to `operator delete(void*)'
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1
------------------------------------

am getting the following error pls help me if u have the sol fo it
Splasher.o(.text+0x1e4): In function `Splasher::Activate()':
: undefined reference to `operator new(unsigned long)'
Splasher.o(.text+0x2e4): In function `Splasher::Deactivate()':
: undefined reference to `operator delete(void*)'
Splasher.o(.gnu.linkonce.r._ZTI8Splasher+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
Configuration.o(.text+0x254): In function `CConfiguration::~CConfiguration()':
: undefined reference to `operator delete(void*)'
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1
------------------------------------

Post your make file. Are you overloading operators new and delete? If so, show me where and show me the code you use (header files + cpp files).

Post your make file. Are you overloading operators new and delete? If so, show me where and show me the code you use (header files + cpp files).

yes i am overloading operators new and delete.
am sending the files u asked for as attachemnt.
pls get back to me as soon as u can.

yes i am overloading operators new and delete.
am sending the files u asked for as attachemnt.
pls get back to me as soon as u can.

Have you overloaded new and delete for class BMPImage? Can you send me the header + source for BMPImage?
I personally would advise overloading the global new and delete operators; see here for a quick howto! :)

Have you overloaded new and delete for class BMPImage? Can you send me the header + source for BMPImage?
I personally would advise overloading the global new and delete operators; see here for a quick howto! :)

instead using another .h file I wrote the "overloading stuff " in my header files.
If am using new and delete am getting the following errors
more undefined references to `operator new(unsigned long)' follow
undefined reference to `operator delete(void*)
undefined reference to `operator new(unsigned long)
undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1

instead using another .h file I wrote the "overloading stuff " in my header files.
If am using new and delete am getting the following errors
more undefined references to `operator new(unsigned long)' follow
undefined reference to `operator delete(void*)
undefined reference to `operator new(unsigned long)
undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1

Hmmm...can I see the .h and .cpp for BMPImage, please? I think this is probably where the problem is...

Hmmm...can I see the .h and .cpp for BMPImage, please? I think this is probably where the problem is...

no its not because of undefined reference to BMPImage, because the files which r not using this BMPImage r also generating the same statement
look at the following message
Configuration.o(.text+0x254): In function `CConfiguration::~CConfiguration()':
: undefined reference to `operator delete(void*)'
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1

no its not because of undefined reference to BMPImage, because the files which r not using this BMPImage r also generating the same statement
look at the following message
Configuration.o(.text+0x254): In function `CConfiguration::~CConfiguration()':
: undefined reference to `operator delete(void*)'
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1

Hmmm...can I see the .cpp and .h for CConfiguration? This should help me factor out the common theme.
Also, I would still like to see the source for BMPImage, just in case :)

Hmmm...can I see the .cpp and .h for CConfiguration? This should help me factor out the common theme.
Also, I would still like to see the source for BMPImage, just in case :)

I got new and delete problem solved now the following are the one am getting could u pls tell how get rid of it plsss
Splasher.o(.gnu.linkonce.r._ZTI8Splasher+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1

I got new and delete problem solved now the following are the one am getting could u pls tell how get rid of it plsss
Splasher.o(.gnu.linkonce.r._ZTI8Splasher+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
Configuration.o(.gnu.linkonce.r._ZTI14CConfiguration+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
make: *** [AppMain.elf] Error 1

How did you solve the "operator new/ delete" errors, by the way?
I'm not sure what could be causing this; googling tells me that it is usually caused by problems with the gcc library. Since you appear to be including this, I'm not sure what to suggest. The only thing I can think of is for you to check that the d:/gnude/lib/gcc-lib/arm-elf/3.3.1 directory contains libgcc.a. Have you compiled any other C++ BREW projects successfully?

How did you solve the "operator new/ delete" errors, by the way?
I'm not sure what could be causing this; googling tells me that it is usually caused by problems with the gcc library. Since you appear to be including this, I'm not sure what to suggest. The only thing I can think of is for you to check that the d:/gnude/lib/gcc-lib/arm-elf/3.3.1 directory contains libgcc.a. Have you compiled any other C++ BREW projects successfully?