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.

C/C++ > Dev-C++

#8864 - Geno - Tue Jul 22, 2003 8:14 am

I've been having a hard time getting the DevKitAdv GCC compiler working with Bloodshed's Dev-C++. Can anyone give any tips to help me?
_________________
Out of Order.

#8926 - Dwedit - Wed Jul 23, 2003 11:23 pm

How to get Devkit Advance working under Bloodshed Dev C++:

First, copy rm.exe from C:\dev-cpp\bin to C:\devkitadv-r5-beta-3\bin
Then copy make.exe to C:\devkitadv-r5-beta-3\bin

Tools > Compiler Options:
* Make a new compiler, call it Devkit advance or something
* Settings tab: Pick your favorite default settings here
* Directories tab: I added these:
Binaries:
C:\devkitadv-r5-beta-3\bin
C:\devkitadv-r5-beta-3\arm-agb-elf\bin

Libaries:
C:\devkitadv-r5-beta-3\lib
C:\devkitadv-r5-beta-3\arm-agb-elf\lib

Includes:
C:\devkitadv-r5-beta-3\arm-agb-elf\include
C:\devkitadv-r5-beta-3\include

C++ Includes:
C:\devkitadv-r5-beta-3\include\c++
C:\devkitadv-r5-beta-3\include\c++\3.2.2

You might also have to edit project options and stuff to override the default output filename (don't want exe's now)
Besides making the elf file, Devcpp has no way of running the game (unless you use an older version and claim you're making a dll), it also can't convert it to a gba file easily.

edit:
Yeah, for best results, make it a "win32 console program".
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#8927 - Geno - Thu Jul 24, 2003 12:37 am

Thanks! But I can't configure it to compile GBA files and execute them in an emu? Oh well.
_________________
Out of Order.

#11394 - Torlus - Sat Oct 04, 2003 4:47 am

Hmm it's an old thread, but well... :)

I had a look at Dev-C++, and decided to use it on Windows then.
I found this thread which helped me at the beginning.

I found a not-too-ugly way to have my GBA programs launched in an emulator directly from Dev-C++. It's rather easy, as you can specify additional files to include to the Dev-C++ generated Makefile.

So I wrote a small file called "after.mak", located in my project's source directory :

Code:

EMU=C:/GBA/VisualBoyAdvance-Dev-1.3.1/VisualBoyAdvance
GBA_BIN=demo.bin

all-after:
   objcopy -O binary $(BIN) $(GBA_BIN)
   $(EMU) $(GBA_BIN)

(Be careful : blank space before each one of the two previous lines must be a TAB).

Then go to Project -> Project Options. Ensure that your project type is "Win32 console" in "General" tab.
I also changed in "Build Options" tab the filename extension from .exe to .elf. It isn't mandatory but looks better.
Then go to "Makefile" tab, and add that "after.mak" file in the list.
Et voila ! Now just press F9 within Dev-C++ to compile and run your program.

Hope this helps...
_________________
GBA,GC,NGPC,GP32,FPGA,DS stuff at http://torlus.com/

#11468 - IAMTHEEVILBEAN - Wed Oct 08, 2003 2:14 am

Torlus wrote:
Hmm it's an old thread, but well... :)

I had a look at Dev-C++, and decided to use it on Windows then.
I found this thread which helped me at the beginning.

I found a not-too-ugly way to have my GBA programs launched in an emulator directly from Dev-C++. It's rather easy, as you can specify additional files to include to the Dev-C++ generated Makefile.

So I wrote a small file called "after.mak", located in my project's source directory :

Code:

EMU=C:/GBA/VisualBoyAdvance-Dev-1.3.1/VisualBoyAdvance
GBA_BIN=demo.bin

all-after:
   objcopy -O binary $(BIN) $(GBA_BIN)
   $(EMU) $(GBA_BIN)

(Be careful : blank space before each one of the two previous lines must be a TAB).

Then go to Project -> Project Options. Ensure that your project type is "Win32 console" in "General" tab.
I also changed in "Build Options" tab the filename extension from .exe to .elf. It isn't mandatory but looks better.
Then go to "Makefile" tab, and add that "after.mak" file in the list.
Et voila ! Now just press F9 within Dev-C++ to compile and run your program.

Hope this helps...


Thanks alot but whhere do you put that program you wrote?

And im having trouble.....when i hit F9 a DOs window comes up...then dissapears
_________________
Moose

#11477 - Torlus - Wed Oct 08, 2003 8:44 am

IAMTHEEVILBEAN wrote:


Thanks alot but whhere do you put that program you wrote?

And im having trouble.....when i hit F9 a DOs window comes up...then dissapears


In general, I put all my files in the same directory (with the project file).
That "DOS" popup is normal. But it seems that in your case VisualBoyAdvance isn't launched, right ?
To see what's happening, launch a "DOS" shell, go to your project directory and try :

make -f Makefile.win

You might have to set up your PATH in order to find Dev-C++ "make.exe" and all its stuff.
_________________
GBA,GC,NGPC,GP32,FPGA,DS stuff at http://torlus.com/

#11482 - IAMTHEEVILBEAN - Wed Oct 08, 2003 12:02 pm

Oh yes visual boy i forgot about that.....how do i make it so that pops up lol

Thanks alot for your help
_________________
Moose

#33802 - Maxamor - Sun Jan 09, 2005 9:21 am

I got Dev-C++ set up with DevKitAdv but when I compile I get a strange error:

Compiler: DevKitADV
Building Makefile: "D:\Devgba\Projects\GBATest\Makefile.win"
Executing make...
make.exe -f "D:\Devgba\Projects\GBATest\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"D:/Devgba/devkitadv/include"
make.exe: /bin/sh.exe: Command not found
make.exe: *** [main.o] Error 127
Execution terminated

But if I use a make.bat in the same files there is no problem. The problem I'm having I believe has to do with my DevC++'s makefile. If you could fill me in on how you got a compatible makefile, I'd be pleased :)

#33812 - Quirky - Sun Jan 09, 2005 4:23 pm

Maxamor wrote:

Compiler: DevKitADV
Building Makefile: "D:\Devgba\Projects\GBATest\Makefile.win"
Executing make...
make.exe -f "D:\Devgba\Projects\GBATest\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"D:/Devgba/devkitadv/include"
make.exe: /bin/sh.exe: Command not found
make.exe: *** [main.o] Error 127
Execution terminated


I don't use Dev-C++, but that's similar to an error I get when running one of my makefiles in MS-DOS instead of MSYS, because sh.exe is only available from within my msys installation (paths and all that).

Are you trying to execute a shell script inside the make file? Perhaps posting the contents of your Makefile.win would be useful.

#33816 - tepples - Sun Jan 09, 2005 5:40 pm

Some Make ports need sh.exe in order to do input or output redirection such as that used by a few data conversion tools, which read files named on the command line and write their output to standard output which gets redirected to a file.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#33832 - Maxamor - Sun Jan 09, 2005 7:59 pm

Here is the contents of my makefile:
Code:
# Project: GBATest
# Makefile created by Dev-C++ 4.9.8.0

CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  =
OBJ  = main.o math.o $(RES)
LINKOBJ  = main.o math.o $(RES)
LIBS =  -L"D:/Devgba/devkitadv/arm-agb-elf/lib" -L"D:/Devgba/devkitadv/lib" ../../devkitadv/lib/libgba.a
INCS =  -I"D:/Devgba/devkitadv/arm-agb-elf/include"  -I"D:/Devgba/devkitadv/include"
CXXINCS =  -I"D:/Devgba/devkitadv/include"
BIN  = GBATest.gba
CXXFLAGS = $(CXXINCS)  -O3
CFLAGS = $(INCS)  -O3

.PHONY: all all-before all-after clean clean-custom

all: all-before GBATest.gba all-after


clean: clean-custom
   rm -f $(OBJ) $(BIN)

$(BIN): $(LINKOBJ)
   $(CPP) $(LINKOBJ) -o "GBATest.gba" $(LIBS)

main.o: main.cpp
   $(CPP) -c main.cpp -o main.o $(CXXFLAGS)

math.o: math.cpp
   $(CPP) -c math.cpp -o math.o $(CXXFLAGS)