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

Developer

Forums

Hi,

I tried to generate MOD file using GNU ARM compiler. This error comes in:
[i]
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

NMAKE : fatal error U1073: don't know how to make 'moon.c'
Stop.
[\i]

Can anybody take a look at my makefile and point out errors?

Thank you.

Check the filenames in the dependancy section:
moon.o:
$(GCC) $(CFLAGS) -o moon.o moon.cpp
Shouldn't that be 'moon.c'?
HTH

Check the filenames in the dependancy section:
moon.o:
$(GCC) $(CFLAGS) -o moon.o moon.cpp
Shouldn't that be 'moon.c'?
HTH

Rock Lee wrote:Check the filenames in the dependancy section:
moon.o:
$(GCC) $(CFLAGS) -o moon.o moon.cpp
Shouldn't that be 'moon.c'?
HTH
No, the file is moon.cpp, not moon.c. What can be the problem?

Rock Lee wrote:Check the filenames in the dependancy section:
moon.o:
$(GCC) $(CFLAGS) -o moon.o moon.cpp
Shouldn't that be 'moon.c'?
HTH
No, the file is moon.cpp, not moon.c. What can be the problem?

Oops, I didn't look carefully. I think the Makefile is complaining since you specified:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(TARGET).o: $(TARGET).c
$(TARGET).o: $(TARGET).cppSo, the Makefile is looking for moon.c from moon.o (using the first rule above). You might want to make your own inferences rule instead.
HTH
UPDATE: Actually, it might work if you just remove the first rule :)

Oops, I didn't look carefully. I think the Makefile is complaining since you specified:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(TARGET).o: $(TARGET).c
$(TARGET).o: $(TARGET).cppSo, the Makefile is looking for moon.c from moon.o (using the first rule above). You might want to make your own inferences rule instead.
HTH
UPDATE: Actually, it might work if you just remove the first rule :)

Rock Lee wrote:Oops, I didn't look carefully. I think the Makefile is complaining since you specified:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(TARGET).o: $(TARGET).c
$(TARGET).o: $(TARGET).cppSo, the Makefile is looking for moon.c from moon.o (using the first rule above). You might want to make your own inferences rule instead.
HTH
UPDATE: Actually, it might work if you just remove the first rule :)
I modified makefile, with $(TARGET).o: $(TARGET).cpp.
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
c:/gnude/bin/arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I../../inc -Ic
:/gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:/gnude\arm-elf\include -O2 -o moon.
o moon.cpp
c:/gnude/bin/arm-elf-ld.exe -Ttext 0 --emit-relocs -entry AEEMod_Load -o
moon.elf -Lc:/gnude/lib/gcc-lib/arm-elf/2.97 AEEModGen.o AEEAppGen.o moon.o GC
CResolver.o moon.o -lgcc
c:/gnude/bin/BREWelf2mod.exe moon.elf moon.mod
The build is successful, but no files are generated (MOD, ELF, O). What can be the problem?
THank you.

Rock Lee wrote:Oops, I didn't look carefully. I think the Makefile is complaining since you specified:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(TARGET).o: $(TARGET).c
$(TARGET).o: $(TARGET).cppSo, the Makefile is looking for moon.c from moon.o (using the first rule above). You might want to make your own inferences rule instead.
HTH
UPDATE: Actually, it might work if you just remove the first rule :)
I modified makefile, with $(TARGET).o: $(TARGET).cpp.
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
c:/gnude/bin/arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I../../inc -Ic
:/gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:/gnude\arm-elf\include -O2 -o moon.
o moon.cpp
c:/gnude/bin/arm-elf-ld.exe -Ttext 0 --emit-relocs -entry AEEMod_Load -o
moon.elf -Lc:/gnude/lib/gcc-lib/arm-elf/2.97 AEEModGen.o AEEAppGen.o moon.o GC
CResolver.o moon.o -lgcc
c:/gnude/bin/BREWelf2mod.exe moon.elf moon.mod
The build is successful, but no files are generated (MOD, ELF, O). What can be the problem?
THank you.

Hmmm... Looks like the arm-elf-ld.exe and BREWelf2mod.exe is called properly. Did Make generate any errors?

Hmmm... Looks like the arm-elf-ld.exe and BREWelf2mod.exe is called properly. Did Make generate any errors?

Rock Lee wrote:Hmmm... Looks like the arm-elf-ld.exe and BREWelf2mod.exe is called properly. Did Make generate any errors?
No error whatsoever. I searched the folders and no files are generated.

Rock Lee wrote:Hmmm... Looks like the arm-elf-ld.exe and BREWelf2mod.exe is called properly. Did Make generate any errors?
No error whatsoever. I searched the folders and no files are generated.

Yea you are right. It looks as if Makefile is just printing out the commands and not executing them. Very very weird :confused: I will have another look...
UPDATE: Try this Makefile out...

Yea you are right. It looks as if Makefile is just printing out the commands and not executing them. Very very weird :confused: I will have another look...
UPDATE: Try this Makefile out...

Rock Lee wrote:Yea you are right. It looks as if Makefile is just printing out the commands and not executing them. Very very weird :confused: I will have another look...
UPDATE: Try this Makefile out...
I tried out the makefile and *.o files are generated, but *.elf and *.mod files are not.
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o A
EEModGen.o ..\..\src/AEEModGen.c
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o A
EEAppGen.o ..\..\src/AEEAppGen.c
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o G
CCResolver.o ..\..\src/misc/GCCResolver.c
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o m
oon.o moon.cpp
In file included from moon_gvm.h:56,
from moon.h:19,
from moon.cpp:2:
gvmod/gvmod.h:73:7: warning: no newline at end of file
In file included from moon.h:20,
from moon.cpp:2:
moon_sbm.h:431:3: warning: no newline at end of file
In file included from moon.cpp:2:
moon.h:380:16: warning: no newline at end of file
In file included from moon.cpp:16:
moon_util.h:83:77: warning: no newline at end of file
In file included from moon.cpp:19:
moon_mc.h:7682:2: warning: no newline at end of file
In file included from moon.cpp:20:
moon_mcplus.h:230:2: warning: no newline at end of file
moon.cpp:167:2: warning: no newline at end of file
---------------------------------------------------------------
TARGET: moon.elf
c:\gnude\bin\arm-elf-ld.exe -EL -Ttext 0 --emit-relocs -entry AEEMod_Loa
d -o moon.elf -Lc:\gnude/lib/gcc-lib/arm-elf/2.97 AEEModGen.o AEEAppGen.o GCCRe
solver.o moon.o
moon.o(.text+0x50c): In function `CGameMoon::InitMoon()':
: undefined reference to `CGvmod::InitGvmod(_IShell*, _IDisplay*, _IHeap*)'
moon.o(.text+0x54c): In function `CGameMoon::InitMoon()':
: undefined reference to `CGvmod::LoadGvmDisplay(int, int)'
moon.o(.text+0x5a8): In function `CGameMoon::FreeMoon()':
: undefined reference to `CGvmod::FreeGvmDisplay(int)'
moon.o(.text+0x614): In function `CGameMoon::OnSuspend()':
: undefined reference to `CGvmod::FreeGvmDisplay(int)'
moon.o(.text+0x688): In function `CGameMoon::OnResume()':
: undefined reference to `CGvmod::InitGvmod(_IShell*, _IDisplay*, _IHeap*)'
moon.o(.text+0x7d0): In function `CGameMoon::OnTimer(int)':
: undefined reference to `CGvmod::UpdateGvmFrameValue()'
moon.o(.text+0xfac): In function `CGameMoon::InitGvmImages()':
: undefined reference to `CGvmod::InitPlayerColor()'
moon.o(.text+0xff8): In function `CGameMoon::SetBB(unsigned char)':
: undefined reference to `CGvmod::SetBB(unsigned char)'
moon.o(.text+0x136c): In function `CGameMoon::FillRect(int, int, int, int)':
: undefined reference to `CGvmod::FillRect(int, int, int, int)'
moon.o(.text+0x13dc): In function `CGameMoon::CopyImage(int, int, _GVMIMAGE&, un
signed char)':
: undefined reference to `CGvmod::CopyImage(int, int, _GVMIMAGE&, unsigned char)
'
moon.o(.text+0x13f8): In function `CGameMoon::SaveLCD()':
: undefined reference to `CGvmod::SaveLCD()'
moon.o(.text+0x1418): In function `CGameMoon::RestoreLCD(unsigned char)':
: undefined reference to `CGvmod::RestoreLCD(unsigned char)'
moon.o(.text+0x1458): In function `CGameMoon::SetStrColor(unsigned char, unsigne
d char)':
: undefined reference to `CGvmod::GetGvmColor(unsigned char)'
moon.o(.text+0x1480): In function `CGameMoon::SetStrColor(unsigned char, unsigne
d char)':
: undefined reference to `CGvmod::GetGvmColor(unsigned char)'
moon.o(.text+0x18ec): In function `CGameMoon::Rand(short, short)':
: undefined reference to `__modsi3'
moon.o(.text+0x1c68): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::LoadImage(_GVMIMAGE&)'
moon.o(.text+0x1ce8): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::CheckImage(_GVMIMAGE&)'
moon.o(.text+0x1d20): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::LoadImage(_GVMIMAGE&)'
moon.o(.text+0x1db4): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::CheckImage(_GVMIMAGE&)'
moon.o(.text+0x1e6c): In function `CGameMoon::DrawNumber(char*, int, int, unsign
ed short, unsigned char)':
: undefined reference to `CGvmod::LoadImage(int)'
moon.o(.text+0x8f70): In function `CGameMoon::PlayHPSPCOMHP()':
: undefined reference to `__divsi3'
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1'
Stop.
What's the problem?
Thank you.

Rock Lee wrote:Yea you are right. It looks as if Makefile is just printing out the commands and not executing them. Very very weird :confused: I will have another look...
UPDATE: Try this Makefile out...
I tried out the makefile and *.o files are generated, but *.elf and *.mod files are not.
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o A
EEModGen.o ..\..\src/AEEModGen.c
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o A
EEAppGen.o ..\..\src/AEEAppGen.c
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o G
CCResolver.o ..\..\src/misc/GCCResolver.c
c:\gnude\bin\arm-elf-gcc.exe -c -DDYNAMIC_APP -mcpu=arm7tdmi -mapcs-fram
e -mthumb-interwork -mlittle-endian -fshort-enums -fno-builtin -I..\..\inc -Ic
:\gnude\lib\gcc-lib\arm-elf\2.97\include -Ic:\gnude\arm-elf\include -Os -O2 -o m
oon.o moon.cpp
In file included from moon_gvm.h:56,
from moon.h:19,
from moon.cpp:2:
gvmod/gvmod.h:73:7: warning: no newline at end of file
In file included from moon.h:20,
from moon.cpp:2:
moon_sbm.h:431:3: warning: no newline at end of file
In file included from moon.cpp:2:
moon.h:380:16: warning: no newline at end of file
In file included from moon.cpp:16:
moon_util.h:83:77: warning: no newline at end of file
In file included from moon.cpp:19:
moon_mc.h:7682:2: warning: no newline at end of file
In file included from moon.cpp:20:
moon_mcplus.h:230:2: warning: no newline at end of file
moon.cpp:167:2: warning: no newline at end of file
---------------------------------------------------------------
TARGET: moon.elf
c:\gnude\bin\arm-elf-ld.exe -EL -Ttext 0 --emit-relocs -entry AEEMod_Loa
d -o moon.elf -Lc:\gnude/lib/gcc-lib/arm-elf/2.97 AEEModGen.o AEEAppGen.o GCCRe
solver.o moon.o
moon.o(.text+0x50c): In function `CGameMoon::InitMoon()':
: undefined reference to `CGvmod::InitGvmod(_IShell*, _IDisplay*, _IHeap*)'
moon.o(.text+0x54c): In function `CGameMoon::InitMoon()':
: undefined reference to `CGvmod::LoadGvmDisplay(int, int)'
moon.o(.text+0x5a8): In function `CGameMoon::FreeMoon()':
: undefined reference to `CGvmod::FreeGvmDisplay(int)'
moon.o(.text+0x614): In function `CGameMoon::OnSuspend()':
: undefined reference to `CGvmod::FreeGvmDisplay(int)'
moon.o(.text+0x688): In function `CGameMoon::OnResume()':
: undefined reference to `CGvmod::InitGvmod(_IShell*, _IDisplay*, _IHeap*)'
moon.o(.text+0x7d0): In function `CGameMoon::OnTimer(int)':
: undefined reference to `CGvmod::UpdateGvmFrameValue()'
moon.o(.text+0xfac): In function `CGameMoon::InitGvmImages()':
: undefined reference to `CGvmod::InitPlayerColor()'
moon.o(.text+0xff8): In function `CGameMoon::SetBB(unsigned char)':
: undefined reference to `CGvmod::SetBB(unsigned char)'
moon.o(.text+0x136c): In function `CGameMoon::FillRect(int, int, int, int)':
: undefined reference to `CGvmod::FillRect(int, int, int, int)'
moon.o(.text+0x13dc): In function `CGameMoon::CopyImage(int, int, _GVMIMAGE&, un
signed char)':
: undefined reference to `CGvmod::CopyImage(int, int, _GVMIMAGE&, unsigned char)
'
moon.o(.text+0x13f8): In function `CGameMoon::SaveLCD()':
: undefined reference to `CGvmod::SaveLCD()'
moon.o(.text+0x1418): In function `CGameMoon::RestoreLCD(unsigned char)':
: undefined reference to `CGvmod::RestoreLCD(unsigned char)'
moon.o(.text+0x1458): In function `CGameMoon::SetStrColor(unsigned char, unsigne
d char)':
: undefined reference to `CGvmod::GetGvmColor(unsigned char)'
moon.o(.text+0x1480): In function `CGameMoon::SetStrColor(unsigned char, unsigne
d char)':
: undefined reference to `CGvmod::GetGvmColor(unsigned char)'
moon.o(.text+0x18ec): In function `CGameMoon::Rand(short, short)':
: undefined reference to `__modsi3'
moon.o(.text+0x1c68): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::LoadImage(_GVMIMAGE&)'
moon.o(.text+0x1ce8): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::CheckImage(_GVMIMAGE&)'
moon.o(.text+0x1d20): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::LoadImage(_GVMIMAGE&)'
moon.o(.text+0x1db4): In function `CGameMoon::DrawItemDescription(unsigned char)
':
: undefined reference to `CGvmod::CheckImage(_GVMIMAGE&)'
moon.o(.text+0x1e6c): In function `CGameMoon::DrawNumber(char*, int, int, unsign
ed short, unsigned char)':
: undefined reference to `CGvmod::LoadImage(int)'
moon.o(.text+0x8f70): In function `CGameMoon::PlayHPSPCOMHP()':
: undefined reference to `__divsi3'
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1'
Stop.
What's the problem?
Thank you.

Well, the compiler is complaining about two missing classes:
CGvmod
CGameMoon
You need to compile those source files also. For the undefined reference to '__divsi3' and '__modsi3', link with with GNU maths library (libm.a) by adding -lm to your linker line in your makefile.
HTH

Well, the compiler is complaining about two missing classes:
CGvmod
CGameMoon
You need to compile those source files also. For the undefined reference to '__divsi3' and '__modsi3', link with with GNU maths library (libm.a) by adding -lm to your linker line in your makefile.
HTH

Rock Lee wrote:Well, the compiler is complaining about two missing classes:
CGvmod
CGameMoon
You need to compile those source files also. For the undefined reference to '__divsi3' and '__modsi3', link with with GNU maths library (libm.a) by adding -lm to your linker line in your makefile.
HTH
Where do I go to add libm.a in my makefile? Could you show me by examples?
Here's my makefile.
Thank you.

Rock Lee wrote:Well, the compiler is complaining about two missing classes:
CGvmod
CGameMoon
You need to compile those source files also. For the undefined reference to '__divsi3' and '__modsi3', link with with GNU maths library (libm.a) by adding -lm to your linker line in your makefile.
HTH
Where do I go to add libm.a in my makefile? Could you show me by examples?
Here's my makefile.
Thank you.

For example:
LDFLAGS = $(LIBDIRS) -lmHTH

For example:
LDFLAGS = $(LIBDIRS) -lmHTH

Rock Lee wrote:For example:
LDFLAGS = $(LIBDIRS) -lmHTH
I added the line as you instructed and it still didn't work. When you say re-compile missing classes:
CGvmod
CGameMoon
I already recomplied in VC. Why is it still complaining? Do I need to include it the makefile? If so, how?
Thank you.

Rock Lee wrote:For example:
LDFLAGS = $(LIBDIRS) -lmHTH
I added the line as you instructed and it still didn't work. When you say re-compile missing classes:
CGvmod
CGameMoon
I already recomplied in VC. Why is it still complaining? Do I need to include it the makefile? If so, how?
Thank you.

Quote:I added the line as you instructed and it still didn't work.Try locating where libm.a is. And then add that directory to the LIBDIR.
Quote:I already recomplied in VC. Why is it still complaining? Do I need to include it the makefile? If so, how? It doesn't matter if you compile your project in VC++ since its separate from Make (the former creates .obj files and the latter creates .o files). You need to specify the the files like this:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(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 $(AEESRCPATH)/misc/GCCResolver.c
filename.o:
$(GCC) $(CFLAGS) -o filename.o [path]\filename.cpp
$(TARGET).o:
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cppHTH
Acutally, if you can compile your project in VC++, then why didn't you use the BREW plug-in to generate the Makefile for you?

Quote:I added the line as you instructed and it still didn't work.Try locating where libm.a is. And then add that directory to the LIBDIR.
Quote:I already recomplied in VC. Why is it still complaining? Do I need to include it the makefile? If so, how? It doesn't matter if you compile your project in VC++ since its separate from Make (the former creates .obj files and the latter creates .o files). You need to specify the the files like this:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(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 $(AEESRCPATH)/misc/GCCResolver.c
filename.o:
$(GCC) $(CFLAGS) -o filename.o [path]\filename.cpp
$(TARGET).o:
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cppHTH
Acutally, if you can compile your project in VC++, then why didn't you use the BREW plug-in to generate the Makefile for you?

Rock Lee wrote:Try locating where libm.a is. And then add that directory to the LIBDIR.
It doesn't matter if you compile your project in VC++ since its separate from Make (the former creates .obj files and the latter creates .o files). You need to specify the the files like this:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(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 $(AEESRCPATH)/misc/GCCResolver.c
filename.o:
$(GCC) $(CFLAGS) -o filename.o [path]\filename.cpp
$(TARGET).o:
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cppHTH
Acutally, if you can compile your project in VC++, then why didn't you use the BREW plug-in to generate the Makefile for you?
For libm.a, can I just move libm.a to the LIBDIRS folder? If not, how do I define that in LIBDIRS? Is it like:
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 $(GCCHOMEPATH)/arm-elf/lib
And this is the error I got.
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
---------------------------------------------------------------
TARGET: moon.elf
c:\gnude\bin\arm-elf-ld.exe -EL -Ttext 0 --emit-relocs -entry AEEMo
d -o moon.elf -Lc:\gnude/lib/gcc-lib/arm-elf/3.3.1 c:\gnude\arm-elf\lib -lm
ModGen.o AEEAppGen.o GCCResolver.o moon.o
c:\gnude\arm-elf\lib: file not recognized: Is a directory
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1
Stop.
For the classes, they are header files, not source files. If I add $gvmod.o:
$(GCC) $(CFLAGS) -o gvmod.o gvmod\gvmod.h, no gvmod.o is generated. How do I generated *.o for classes?
Thank you.

Rock Lee wrote:Try locating where libm.a is. And then add that directory to the LIBDIR.
It doesn't matter if you compile your project in VC++ since its separate from Make (the former creates .obj files and the latter creates .o files). You need to specify the the files like this:
#-----------------------------------------------------------------------
# Object File Dependencies
# You may well want to add more dependencies here.
#-----------------------------------------------------------------------
$(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 $(AEESRCPATH)/misc/GCCResolver.c
filename.o:
$(GCC) $(CFLAGS) -o filename.o [path]\filename.cpp
$(TARGET).o:
$(GCC) $(CFLAGS) -o $(TARGET).o $(TARGET).cppHTH
Acutally, if you can compile your project in VC++, then why didn't you use the BREW plug-in to generate the Makefile for you?
For libm.a, can I just move libm.a to the LIBDIRS folder? If not, how do I define that in LIBDIRS? Is it like:
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 $(GCCHOMEPATH)/arm-elf/lib
And this is the error I got.
C:\BREWSDKv2.1.0\Examples\moon>nmake /f moon.mak
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
---------------------------------------------------------------
TARGET: moon.elf
c:\gnude\bin\arm-elf-ld.exe -EL -Ttext 0 --emit-relocs -entry AEEMo
d -o moon.elf -Lc:\gnude/lib/gcc-lib/arm-elf/3.3.1 c:\gnude\arm-elf\lib -lm
ModGen.o AEEAppGen.o GCCResolver.o moon.o
c:\gnude\arm-elf\lib: file not recognized: Is a directory
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1
Stop.
For the classes, they are header files, not source files. If I add $gvmod.o:
$(GCC) $(CFLAGS) -o gvmod.o gvmod\gvmod.h, no gvmod.o is generated. How do I generated *.o for classes?
Thank you.

Quote:For libm.a, can I just move libm.a to the LIBDIRS folder? If not, how do I define that in LIBDIRS? Is it like: LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 $(GCCHOMEPATH)/arm-elf/libLIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 -L$(GCCHOMEPATH)/arm-elf/libQuote:For the classes, they are header files, not source files. If I add $gvmod.o: $(GCC) $(CFLAGS) -o gvmod.o gvmod\gvmod.h, no gvmod.o is generated. How do I generated *.o for classes?So are you saying that you don't have the source, but you do have the .o file and the header file?

Quote:For libm.a, can I just move libm.a to the LIBDIRS folder? If not, how do I define that in LIBDIRS? Is it like: LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 $(GCCHOMEPATH)/arm-elf/libLIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 -L$(GCCHOMEPATH)/arm-elf/libQuote:For the classes, they are header files, not source files. If I add $gvmod.o: $(GCC) $(CFLAGS) -o gvmod.o gvmod\gvmod.h, no gvmod.o is generated. How do I generated *.o for classes?So are you saying that you don't have the source, but you do have the .o file and the header file?

Rock Lee wrote:LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 -L$(GCCHOMEPATH)/arm-elf/libSo are you saying that you don't have the source, but you do have the .o file and the header file?
I don't have the source, but I have the .o file and the header file. How do I make it work?
Thank you.

Rock Lee wrote:LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 -L$(GCCHOMEPATH)/arm-elf/libSo are you saying that you don't have the source, but you do have the .o file and the header file?
I don't have the source, but I have the .o file and the header file. How do I make it work?
Thank you.

Well, all you have to do is to link your .o files with your project. Like this:
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
ADDTL_FILES = object1.o \
[PATH]\object2.o \
[PATH]\object3.o
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(MODULE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
@echo ---------------------------------------------------------------
$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(EXETYPE)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(ADDTL_FILES) $(LIBS) $(LINK_ORDER)
@echo ---------------------------------------------------------------HTH

Well, all you have to do is to link your .o files with your project. Like this:
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
ADDTL_FILES = object1.o \
[PATH]\object2.o \
[PATH]\object3.o
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(MODULE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
@echo ---------------------------------------------------------------
$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(EXETYPE)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(ADDTL_FILES) $(LIBS) $(LINK_ORDER)
@echo ---------------------------------------------------------------HTH

I added these lines:
GVMOD_DIR = C:\BREWSDKv2.1.0\Examples\moon\gvmod
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
ADDTL_FILES = $(GVMOD_DIR)\gvmod.o
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(MODULE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
@echo ---------------------------------------------------------------
$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(EXETYPE)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(ADDTL_FILES) $(LIBS) $(LINK_ORDER)
@echo ---------------------------------------------------------------
This is the error message that I got back.
/cygdrive/c/gnude/bin/arm-elf-ld: C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o:
unable to find THUMB glue '__ConvertHBM__FPUcT1UcT1_from_thumb' for `ConvertHBM_
_FPUcT1UcT1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.CopyImage__6CGvmodFiT1R9_GVMIMAGE
Uc+0x2bc): In function `$b':
: internal error: dangerous error
/cygdrive/c/gnude/bin/arm-elf-ld: C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o:
unable to find THUMB glue '__ConvertHBM__FPUcT1UcT1_from_thumb' for `ConvertHBM_
_FPUcT1UcT1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.CopyImage__6CGvmodFiT1R9_GVMIMAGE
Uc+0x2e6): In function `$b':
: internal error: dangerous error
: undefined reference to `__call_via_r1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.LoadImage__6CGvmodFi+0x16): In fu
nction `$b':
: undefined reference to `__call_via_r4'
/cygdrive/c/gnude/bin/arm-elf-ld: C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o:
unable to find THUMB glue '__ConvertHBM__FPUcT1UcT1_from_thumb' for `ConvertHBM_
_FPUcT1UcT1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.LoadImage__6CGvmodFi+0x2a): In fu
nction `$b':
: internal error: dangerous error
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.ConvertHBM__FPUcT1UcT1+0x3f0): In
function `$b':
: undefined reference to `__call_via_r1'
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1'
Stop.

I added these lines:
GVMOD_DIR = C:\BREWSDKv2.1.0\Examples\moon\gvmod
#-----------------------------------------------------------------------
# All target
#-----------------------------------------------------------------------
all: $(TARGET).$(MODULE)
ADDTL_FILES = $(GVMOD_DIR)\gvmod.o
#-----------------------------------------------------------------------
# Targets for making the actual binary
#-----------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(MODULE)
$(ELF2MODTOOL) $(TARGET).$(EXETYPE) $(TARGET).$(MODULE)
@echo ---------------------------------------------------------------
$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET: $(TARGET).$(EXETYPE)
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LDFLAGS) \
$(APP_OBJS) $(ADDTL_FILES) $(LIBS) $(LINK_ORDER)
@echo ---------------------------------------------------------------
This is the error message that I got back.
/cygdrive/c/gnude/bin/arm-elf-ld: C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o:
unable to find THUMB glue '__ConvertHBM__FPUcT1UcT1_from_thumb' for `ConvertHBM_
_FPUcT1UcT1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.CopyImage__6CGvmodFiT1R9_GVMIMAGE
Uc+0x2bc): In function `$b':
: internal error: dangerous error
/cygdrive/c/gnude/bin/arm-elf-ld: C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o:
unable to find THUMB glue '__ConvertHBM__FPUcT1UcT1_from_thumb' for `ConvertHBM_
_FPUcT1UcT1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.CopyImage__6CGvmodFiT1R9_GVMIMAGE
Uc+0x2e6): In function `$b':
: internal error: dangerous error
: undefined reference to `__call_via_r1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.LoadImage__6CGvmodFi+0x16): In fu
nction `$b':
: undefined reference to `__call_via_r4'
/cygdrive/c/gnude/bin/arm-elf-ld: C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o:
unable to find THUMB glue '__ConvertHBM__FPUcT1UcT1_from_thumb' for `ConvertHBM_
_FPUcT1UcT1'
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.LoadImage__6CGvmodFi+0x2a): In fu
nction `$b':
: internal error: dangerous error
C:\BREWSDKv2.1.0\Examples\moon\gvmod\gvmod.o(i.ConvertHBM__FPUcT1UcT1+0x3f0): In
function `$b':
: undefined reference to `__call_via_r1'
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1'
Stop.

Alight. Lets try this, change
TARG = -mthumb
to
TARG = #-mthumb
Basically, you are commenting that line since the object files that you have aren't thumb. So this should get rid of the "unable to find THUMB glue" error.
HTH

Alight. Lets try this, change
TARG = -mthumb
to
TARG = #-mthumb
Basically, you are commenting that line since the object files that you have aren't thumb. So this should get rid of the "unable to find THUMB glue" error.
HTH

I recompiled my program and the only errors came up was to do with _modsi3 and _divsi3. I added the lines:
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a and libm.a
#-----------------------------------------------------------------------
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 -L$(GCCHOMEPATH)/arm-elf/lib
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
LDFLAGS = $(LIBDIRS) -lm
Here is the errors:
---------------------------------------------------------------
TARGET: moon.elf
c:\gnude\bin\arm-elf-ld.exe -EL -Ttext 0 --emit-relocs -entry AEEMod_Loa
d -o moon.elf -Lc:\gnude/lib/gcc-lib/arm-elf/3.3.1 -Lc:\gnude/arm-elf/lib AEEMo
dGen.o AEEAppGen.o GCCResolver.o moon.o
moon.o(.text+0x16ac): In function `CGameMoon::Rand(short, short)':
: undefined reference to `__modsi3'
moon.o(.text+0x8a18): In function `CGameMoon::PlayHPSPCOMHP()':
: undefined reference to `__divsi3'
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1'
Stop.
What can be the problem?
Thank you.

I recompiled my program and the only errors came up was to do with _modsi3 and _divsi3. I added the lines:
#-----------------------------------------------------------------------
# Library search path options. It points the location of libgcc.a and libm.a
#-----------------------------------------------------------------------
LIBDIRS = -L$(GCCHOMEPATH)/lib/gcc-lib/arm-elf/3.3.1 -L$(GCCHOMEPATH)/arm-elf/lib
#-----------------------------------------------------------------------
# Linker flag definitions
#-----------------------------------------------------------------------
LDFLAGS = $(LIBDIRS) -lm
Here is the errors:
---------------------------------------------------------------
TARGET: moon.elf
c:\gnude\bin\arm-elf-ld.exe -EL -Ttext 0 --emit-relocs -entry AEEMod_Loa
d -o moon.elf -Lc:\gnude/lib/gcc-lib/arm-elf/3.3.1 -Lc:\gnude/arm-elf/lib AEEMo
dGen.o AEEAppGen.o GCCResolver.o moon.o
moon.o(.text+0x16ac): In function `CGameMoon::Rand(short, short)':
: undefined reference to `__modsi3'
moon.o(.text+0x8a18): In function `CGameMoon::PlayHPSPCOMHP()':
: undefined reference to `__divsi3'
NMAKE : fatal error U1077: 'c:\gnude\bin\arm-elf-ld.exe' : return code '0x1'
Stop.
What can be the problem?
Thank you.