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 > Setting up environment!

#33770 - Micmaster - Sat Jan 08, 2005 3:23 pm

I am very new to all of this...I cannot seem to set up the environment correctly. I downloaded devkit and DkArm but cannot get sample bin's to compile -- it seems some includes just aren't registering. Problem with setting include path in gcc? -Idir right? Also tried with IDE, like Dev-c++.. is it possible to compile GBA binaries in an IDE like this? It would be easier. Again, nothing will compile. I assume this is an environment problem. Could anyone provide / point me to explicit super-n00b instructions? So frustrated, been searching hour hours...

#33772 - yaustar - Sat Jan 08, 2005 6:38 pm

http://forum.gbadev.org/viewtopic.php?t=3738&highlight=dev+cpp+setup
and
http://forum.gbadev.org/viewtopic.php?t=1736

Should help.
_________________
[Blog] [Portfolio]

#33813 - Quirky - Sun Jan 09, 2005 4:54 pm

Micmaster wrote:
I am very new to all of this...I cannot seem to set up the environment correctly. I downloaded devkit and DkArm but cannot get sample bin's to compile -- it seems some includes just aren't registering. Problem with setting include path in gcc? -Idir right?


-Idir is the right way to go about it, but it is all hidden inside the examples' Makefiles.

I've just compiled the dkarm SimpleBGScroll example. Here's what I did:

Download + install devkitarm_r6
Download Wintermute's libgba and unzip it
Download the example SimpleBGScroll + unzip it
Change 2 lines in the SimpleBGScroll Makefile and in the libgba Makefile:

in libgba wrote:

# export PATH := /c/devkitARM_r5/bin:/bin
export PATH := /d/gbadev/devkitARM_r6/bin:/bin


in SimpleBGScroll wrote:

#export PATH := /c/devkitARM_r6/bin:/bin:/c/bin
export PATH := /d/gbadev/devkitARM_r6/bin:/bin:/c/bin

#LIBGBA := /c/projects/gba/libgba
LIBGBA := /d/gbadev/Projects/libgba


The paths depend on where you unzip stuff of course. I have code in D:/gbadev/Projects , and compilers in D:/gbadev/

Then from a MSYS prompt, typing make in the SimpleBGScroll directory gave the desired results.

I'd recommend getting it up and running the "ugly" way before trying to configure an IDE. Problems in the IDE may not be as obvious as they are from the command line, or the IDE itself may introduce new headaches.

#33846 - Micmaster - Sun Jan 09, 2005 10:45 pm

I read your replies but haven't tested them yet - I just wanted to thank you for posting a solution. I hope they will work - I need to learn how to write makefiles, because for whatever reason I couldn't get gcc to recognize all the included files, even when using -Idir, from the command line. And I'm unfamiliar with bash (which is what Msys is, right?). I'll post a new reply or another topic if I still have trouble.

#33883 - Micmaster - Mon Jan 10, 2005 3:07 pm

Ok..still can't get this to work. What is libgba and where do I get it? Couldn't find it at http://homepage.ntlworld.com/wintermute2002/

#33887 - ScottLininger - Mon Jan 10, 2005 7:26 pm

I think I'll use this opportunity to ask if anyone is willing to create a Windows installer that puts DevKitARM and everything one needs to compile an example GBA onto your harddrive, ideally with a few simple example projects included, with Makefiles and the whole bit.

This topic has come up a few times, and people tend to point others to a variety of sites with multiple downloads and no clear tutorial on how to make this work.

If you are one of the folks who is using DevKitARM successfully, then all you'd need to do is download a freeware installer creator such as SpoonInstaller and point it at your C:\Devkitarm directory. It will create an easy-to-distribute installer that we can get posted to the main GBADEV site for all to enjoy.

If there are extra steps that need to be done, such as changing PATH variables and such, then a nice, simple README.TXT that comes with the installer would be wonderful.

There are a lot of people out there (like me) who have had trouble getting DevKitArm to work, and we would be most grateful!

-Scott

#33888 - Micmaster - Mon Jan 10, 2005 8:09 pm

You know what? I'll do it.
I finally got DKArm working, a couple of hours ago actually.
I'm not promising ninja swiftness on this project, but I bet I can do it.
A brief outline to others:
* I downloaded DKArm.
* I downloaded Msys.
* I downloaded the Tonc tutorial (from this site), using its example code and makefiles.
Never having used any of this before, I couldn't figure out how to navigate and get the makefiles to work with Msys. GCC was giving all kinds of errors, such as that the included files weren't working correctly. I had to edit Msys /etc/profile to include

export PATH="/c/dkarm/bin:$PATH"

to get GCC working, eventually. I actually had to copy several files from the Msys bin directory to DKArm, as apparently the version I have (I believe the latest at this time 1/10/05) was not up to date with Msys, which I use to run the makefiles. I copied rm.exe (64,464 bytes) from Msys/1.0/bin to DKArm/bin, I copied make.exe (135,680 bytes) from Msys/1.0/bin to DkArm/bin, I copied sh.exe (68,096 bytes) actually from Devkitadvance (because the sh.exe from Msys is NOT the same thing at all). I copied cygwin1.dll (717,616 bytes) from DevkitAdv to DKArm. I can't remember if that was necessary or not. To run makefiles, navigate (I use Msys) to the folder with your makefile (newbies: type cd /c/mydirectory) and run make with the correct parameters, which I do not have documented right here. Batch files also work (or a lot of typing manually from the prompt), but you will need to know exactly what parameters to use. They are illustrated quite clearly in the Tonc tutorial.

That's all I can think of off the top of my head. I'm sure there's more to it. I had a lot of problems setting this all up, so I fully support the idea of a setup program with everything ready to go, with full documentation. I'll work on it when I have time. Hopefully this short explanation here will help out others who had the same types of problems.

As for setting up and IDE, screw that. For now. I have come to the conclusion that it might not be possible using Dev-C++ without major tweaking: everytime I try to add MORE THAN ONE bin directory, under options -> compiler options, it makes an error with the bin directory trying to compile. As far as I can tell, it is necessary to have more than one bin directory, and I can't find another way to do that, with Dev-c++ anyway. I'm sure if I had MSVC++ it would be easy.

Whew. I think that's all for now. Any questions?

#33889 - ScottLininger - Mon Jan 10, 2005 8:30 pm

Micmaster wrote:
You know what? I'll do it.


Awesome! The documentration doesn't have to be fancy. A working project sort of documents itself. If one can install the thing and then compile right away, then one can figure it out from there.

Thanks! Let me know if there's anything I can do to help. I could slap together an example program that's super simple, if that's useful. I think any of the little programs from the pern project would be good, too.