gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Problems with VC++

#20207 - mr_schmoe - Tue May 04, 2004 8:41 pm

OK, I know that this issue has been discussed a hundred times before. I've search the forum and have found several people with similar problems but none matching my own. I followed the direction for the GBA Project Appwizard r2.6 but when I try to compile it, I get this nasty error message saying it doesn't know how to make crt0.o. Everyone seems to get past this point, what am I doing wrong? Please help. Thank you. If you need more info on my configuration, let me know.

#20209 - DiscoStew - Tue May 04, 2004 9:03 pm

Would it be possible to show us exactly what the error is (copy and paste), and perhaps the MAK file that the GBA Project AppWizard creates. Also, what options did you choose before creating your project? Is the a file by the name of crt0.s in the same folder?

Sorry for all the questions, but the more information, the easier to fix a problem.
_________________
DS - It's all about DiscoStew

#20212 - mr_schmoe - Tue May 04, 2004 9:35 pm

I don't have time at the moment, gotta go to work soon, but I'll post that info tomorrow. Thanks for you help.

#20245 - mr_schmoe - Wed May 05, 2004 3:37 pm

this is the error I get:

--------------------Configuration: bob - Win32 Debug--------------------
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 'interupt.o'
Stop.
Error executing NMAKE.

bob.gba - 1 error(s), 0 warning(s)

the make file goes something like this:

# ------------------------------------------
# Title: Default Makefile for use in VC++
# File: bob.mak
# Revision: 01/06/2002
#
# Author: Benjamin D. Hale
# Orignally by: Jaap Suter
# Contributed to by: Christer Andersson
#
# Info: This file is contains the make-instructions
# for the project. Replace DEVDIR with the appropriate
# base directory for devkitadv. After you make the
# needed modifications here rename this file to
# <project_name>.mak so Visual C++ does not get
# confused.
# -------------------------------------------

# -------------------------------------------
# Project name definition makes this whole thing
# a lot easier to use. Only two total modifications
# (other than what .o files will be needed)
# should be needed to get this working with your
# compiler and Visual C++. Replace "Default" with
# your project's name.
# -------------------------------------------

PROJECT = bob

# -------------------------------------------
# Define some directories;
# -------------------------------------------

# -------------------------------------------
# Base Directory for gcc arm-agb-elf replace with
# wherever you put your gba devkitadv files.
# -------------------------------------------

DEVDIR = d:\devkitadv

# -------------------------------------------
# Source directory (where your project's source files are located.)
# -------------------------------------------

SRCDIR = C:\Program Files\Microsoft Visual Studio\MyProjects\bob

# -------------------------------------------
# Compiler Directories for binaries, includes and libs.
# -------------------------------------------

CMPDIR = $(DEVDIR)\bin
LIBDIR = $(DEVDIR)\lib\gcc-lib\arm-agb-elf\3.0.2\interwork
LIBDIR2 = $(DEVDIR)\arm-agb-elf\lib\interwork
INCDIR = $(DEVDIR)\lib\gcc-lib\arm-agb-elf\3.0.2\include
INCDIR2 = $(DEVDIR)\arm-agb-elf\include

# -------------------------------------------
# END of directory defines
# -------------------------------------------

# -------------------------------------------
# Define what extensions we use;
# -------------------------------------------
.SUFFIXES : .cpp .c .s

# -------------------------------------------
# Define the flags for the compilers;
# -------------------------------------------
CFLAGS = -I $(INCDIR2) -I $(INCDIR) -I $(SRCDIR) -mthumb-interwork -c -g -O2 -Wall -fverbose-asm
SFLAGS = -I $(INCDIR2) -I $(INCDIR) -mthumb-interwork
LDFLAGS = -L $(LIBDIR) -L $(LIBDIR2) -T LinkScript

# -------------------------------------------
# Define the list of all O files;
# Just follow the syntax shown to add any
# other objects your project may need to
# compile properly. You will need to add
# files to this part to make it work with
# your project add a \ to the end of all o
# files except the last one. Like below.
# -------------------------------------------

O_FILES = \
crtbegin.o \
crtend.o \
interupt.o \
bob.o \
crt0.o

# -------------------------------------------
# There should be no need to modify anything
# below here.
# -------------------------------------------

# -------------------------------------------
# Define the final dependecy;
# -------------------------------------------
all : $(PROJECT).gba

# -------------------------------------------
# Define the copy from .elf to .bin file
# -------------------------------------------
$(PROJECT).gba : $(PROJECT).elf
$(CMPDIR)\objcopy -v -O binary $(PROJECT).elf $(PROJECT).gba
-@echo ------------------------------------------
-@echo Done
-@echo ------------------------------------------

# -------------------------------------------
# Define the linker instruction;
# -------------------------------------------
$(PROJECT).elf : $(O_FILES)
$(CMPDIR)\ld $(LDFLAGS) -o $(PROJECT).elf $(O_FILES) -lstdc++ -lgcc -lc
-@echo ------------------------------------------
-@echo Linking Done
-@echo ------------------------------------------

# -------------------------------------------
# Define each compile;
# -------------------------------------------
{$(SRCDIR)}.cpp.o:
$(CMPDIR)\gcc $(CFLAGS) $<
-@echo ------------------------------------------
-@echo CPP-Sources Compiled
-@echo ------------------------------------------

{$(SRCDIR)}.c.o:
$(CMPDIR)\gcc $(CFLAGS) $<
-@echo ------------------------------------------
-@echo C-sources Compiled
-@echo ------------------------------------------

# -------------------------------------------
# Define each assemble;
# -------------------------------------------
{$(SRCDIR)}.s.o:
$(CMPDIR)\as $(SFLAGS) $(SRCDIR)\$*.s -o$@
-@echo ------------------------------------------
-@echo ASM-Sources Compiled
-@echo ------------------------------------------

# -------------------------------------------
# Any problems with getting this working email
# questions to whatzdat_pimp@hotmail.com .
# This was tested on devkitadv r4 and Visual C++ 6
# on a p3 450/512mb/Windows XP Pro.
# -------------------------------------------
# EOF;

and no, the crt0.s or crt0.o isn't there, I don't even know what that is.

#20249 - poslundc - Wed May 05, 2004 4:38 pm

Your makefile is looking for a file called "interupt" with an extension of ".c", ".cpp" or ".s".

Either remove it from your makefile, or check the spelling of the file name (it's "interrupt", not "interupt", although it won't matter if it's spelled incorrectly in both places).

You may still run into other problems from the look of it, though. It doesn't seem as though you have a complete devkit running.

Dan.

#20254 - mr_schmoe - Wed May 05, 2004 6:09 pm

I checked on the spelling, everything checks out. I'm using devkitadv r4. I'll download r5 and try that. Thanks

#20255 - mr_schmoe - Wed May 05, 2004 7:02 pm

Actually, I remember one other thing. The original make files had the following:
Code:
# -------------------------------------------
# Define each compile;
# -------------------------------------------
{$(SRCDIR)}.cpp.o::
   $(CMPDIR)\gcc  $(CFLAGS) $<
   -@echo ------------------------------------------
   -@echo CPP-Sources Compiled
   -@echo ------------------------------------------

{$(SRCDIR)}.c.o::
   $(CMPDIR)\gcc  $(CFLAGS) $<
   -@echo ------------------------------------------
   -@echo C-sources Compiled
   -@echo ------------------------------------------


Which I changed to:
Code:

# -------------------------------------------
# Define each compile;
# -------------------------------------------
{$(SRCDIR)}.cpp.o:
   $(CMPDIR)\gcc  $(CFLAGS) $<
   -@echo ------------------------------------------
   -@echo CPP-Sources Compiled
   -@echo ------------------------------------------

{$(SRCDIR)}.c.o:
   $(CMPDIR)\gcc  $(CFLAGS) $<
   -@echo ------------------------------------------
   -@echo C-sources Compiled
   -@echo ------------------------------------------

because I got some error telling me "cannot have : and :: dependents for same target"

#20321 - Stray7Xi - Fri May 07, 2004 12:24 am

I believe your problem is this line:

Code:
SRCDIR = C:\Program Files\Microsoft Visual Studio\MyProjects\bob


You can't have spaces in your path... you can use the 8.3 style paths though (i.e. C:\progra~1\micros~1\MyProjects\bob )

That should be the proper way to get rid of the :/:: dependency problem. You should probably put that part back to it's original form.

#20333 - mr_schmoe - Fri May 07, 2004 4:09 pm

It worked!! Thank you very much. All I had to do was get rid of the spaces. Actually, I changed the directory all together. I put in d:\projects and it worked fine. Thanks again.