Page 1 of 2

Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Mon Aug 04, 2008 4:43 pm
by jithin.rao
Well I had done according to the devkitPro site on Visual Studio Express Edition, but couldn't see the results.
Image
Got the Makefile on the new Project Menu!

Image
Configuration Settings Done on the Debug Settings.

Image
Configuration Settings Done on the Release Settings.

Image
Got the Project running, but i can't see any makefile file there!

Image
Now adding a new cpp file

Image
main.cpp file creation window

Image
a sample code copy pasted, and compiled look at the log - no errors but no arm9_1.nds file generated! WHY? did i go somewhere wrong?

Here's the BuildLog that Visual Studio generates at each build/compilein the debug folder :

Code: Select all

Build Log 
 	 	Build started: Project: arm9_1, Configuration: Debug|Win32

Command Lines 
 	 	Creating temporary file "C:\Users\Jithin\AppData\Local\Temp\BAT0000022512664.bat" with contents
[
@echo off

make -r 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/’

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"

exit 1

:VCEnd
]
Creating command line "C:\Users\Jithin\AppData\Local\Temp\BAT0000022512664.bat"
Output Window 
 	 	Performing Makefile project actions
make: *** No targets specified and no makefile found.  Stop.
Results 
 	 	Build log was saved at "file://c:\DSProjects\arm9_1\Debug\BuildLog.htm"
arm9_1 - 0 error(s), 0 warning(s)
Ok, that has some error goin on the gcc compiler end, anyone for the help?

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Mon Aug 04, 2008 5:08 pm
by jithin.rao
OK! I got the mistake just skipped the last sentence mentioned, the make file from the templates is copied on to the folder and the sources of this solution is copied on to the /Source folder too. Now when i compile after adding the MakeFile with the script, it compiles and nds is compiled out!
Image

Code: Select all

1>------ Build started: Project: arm9_1, Configuration: Debug Win32 ------
1>Performing Makefile project actions
1>main.c
1>arm-eabi-gcc -MMD -MP -MF /c/DSProjects/arm9_1/build/main.d -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/DSProjects/arm9_1/include -I/c/DSProjects/arm9_1/build -I/c/devkitPro/libnds/include -I/c/devkitPro/libnds/include -I/c/DSProjects/arm9_1/build -DARM9 -c /c/DSProjects/arm9_1/source/main.c -o main.o
1>linking arm9_1.elf
1>built ... arm9_1.arm9
1>Nintendo DS rom tool 1.38 - May 15 2008
1>by Rafael Vuijk, Dave Murphy, Alexei Karpenko
1>built ... arm9_1.nds
1>Build log was saved at "file://c:\DSProjects\arm9_1\Debug\BuildLog.htm"
1>arm9_1 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
The COMPILATION WAS SUCCESSFUL!

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Mon Aug 04, 2008 8:59 pm
by jithin.rao

Code: Select all

#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------

ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM)
endif

include $(DEVKITARM)/ds_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET		:=	$(shell basename $(CURDIR))
BUILD		:=	build
SOURCES		:=	gfx source data  
INCLUDES	:=	include build

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH	:=	-mthumb -mthumb-interwork

# note: arm9tdmi isn't the correct CPU arch, but anything newer and LD
# *insists* it has a FPU or VFP, and it won't take no for an answer!
CFLAGS	:=	-g -Wall -O2\
 			-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
			-ffast-math \
			$(ARCH)

CFLAGS	+=	$(INCLUDE) -DARM9
CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions

ASFLAGS	:=	-g $(ARCH)
LDFLAGS	=	-specs=ds_arm9.specs -g $(ARCH) -mno-fpu -Wl,-Map,$(notdir $*.map)

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:= -lnds9
 
 
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS	:=	$(LIBNDS)
 
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
 
export OUTPUT	:=	$(CURDIR)/$(TARGET)
 
export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir))
export DEPSDIR	:=	$(CURDIR)/$(BUILD)

CFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.bin)))
 
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
	export LD	:=	$(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
	export LD	:=	$(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------

export OFILES	:=	$(BINFILES:.bin=.o) \
					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
 
export INCLUDE	:=	$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					-I$(CURDIR)/$(BUILD)
 
export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib)
 
.PHONY: $(BUILD) clean
 
#---------------------------------------------------------------------------------
$(BUILD):
	@[ -d $@ ] || mkdir -p $@
	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
 
#---------------------------------------------------------------------------------
clean:
	@echo clean ...
	@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 $(TARGET).ds.gba 
 
 
#---------------------------------------------------------------------------------
else
 
DEPENDS	:=	$(OFILES:.o=.d)
 
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).nds	: 	$(OUTPUT).arm9
$(OUTPUT).arm9	:	$(OUTPUT).elf
$(OUTPUT).elf	:	$(OFILES)
 
#---------------------------------------------------------------------------------
%.o	:	%.bin
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	$(bin2o)
 
 
-include $(DEPENDS)
 
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
Could some one help me out on this make file script? I am pretty confused!

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Tue Aug 05, 2008 5:30 am
by WinterMute
What is it you're having trouble with?

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Tue Aug 05, 2008 12:08 pm
by jithin.rao
Now i am havin trouble with the makefile, the code is totally new as i am not aware of the shell script. A couple of simple things i would like to do is :
1. Change the output directory for .nds
2. Change the folder of object files .o
3. add a new include directory(plannin to add more functionalities)

etc.

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Tue Aug 26, 2008 7:58 pm
by Missle Launch
All you need to do is add one of the makefiles from devkitPro's examples to your project, I thought?

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Wed Aug 27, 2008 5:34 am
by WinterMute
jithin.rao wrote:Now i am havin trouble with the makefile, the code is totally new as i am not aware of the shell script. A couple of simple things i would like to do is :
1. Change the output directory for .nds
2. Change the folder of object files .o
These two I would advise leaving alone for now unless the current layout makes some part of your workflow impossible.

The sample projects evolved from a need to provide a means for standardising the project layout in a way that makes it easy for everyone to share code. Previously users were using various build processes which only worked on a particular platform or if non standard components were present. Sticking with the sample layouts also makes it much easier to work with upgraded toolchains when they're released.
3. add a new include directory(plannin to add more functionalities)

etc.
Adding a new include directory is a simple matter of adding the folder to the INCLUDES list in the makefile. Note that all directories within the project are specified relative to the makefile location.

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Sun Aug 31, 2008 5:25 pm
by AeR4
Hello, I'm new here, and wanted to set up my visual c++ 2008.

I've installed devkitpro and followed this guide: devkitPro - Visual c++ Express
But if i copy and paste an example code of the devkit, and want to compile it, visual c++ always says there is 1 error.

What did I wrong?

Greetings,
AeR4

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Tue Sep 02, 2008 4:15 pm
by jeffool
Okay, I feel like a bit of a jackhole for even asking, as once-upon-a-time programming was easy, but, I have a problem in this vein that apparently the OP solved.

When I build, I get:
"Unable to start program 'c:\...\demo01\demo01.nds'
The system cannot find the file specified."

No errors, but no .nds file.
So, which makefile (or additional files) am I suppose to copy into what folder? And where will the .nds end up? I have devkitPro installed to the default dir, as well as Visual Studio 2008.

Re: Visual Studio 2008 + Vista + devkitPro = Not Compiling!

Posted: Tue Sep 02, 2008 11:22 pm
by WinterMute
AeR4 wrote: But if i copy and paste an example code of the devkit, and want to compile it, visual c++ always says there is 1 error.

What did I wrong?
Can you see what the actual error is? It's kind of hard to help without knowing that.