#102959 - Plystire - Mon Sep 18, 2006 7:07 am
I read through the FAQ and tried my hardest (3 days) to get it going. I downloaded the MinGW compiler for starters, however, it doesn't recognise included header files.
This is strange to me since the MinGW main site states that downloading and installing of the files will allow you to compile via the console. (I'm running through Windows 'cmd') typing "gcc -c hello.c" returned the following error correlating to my above problem.
hello.c:1:No include path in which to find stdio.h
the file is saved in the parent directory of the include files. They're folder is named "include"
This is probably just one of the problems I'm gonna be encountering along the way, but some assistance would be greatly appreciated, since I've navigated through all the provided directories that came with MinGW, and I can't find any file that would allow me to set up where the compiler should look for include or lib files.
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#102961 - Philderbeast - Mon Sep 18, 2006 7:08 am
try using the devkitASM this will set everything up for you realy easly
#102973 - Spaceface - Mon Sep 18, 2006 10:18 am
Philderbeast means devKitPro: http://www.devkitpro.org/
it's one setup file and installs everything in the process.. saves you lots of time
_________________
LEKKER KNUFFELE MAATJE!
#102985 - tepples - Mon Sep 18, 2006 1:28 pm
Plystire is talking about MinGW, which targets Microsoft Windows, not devkitPro, which targets GBA and DS. I'm guessing that Plystire is at the stage of learning where (s)he has yet to make a game in the C language for any platform, and conventional wisdom is that native compilation is easier for people stuck at hello world.
Solution: Use the MinGW Updater.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#103011 - keldon - Mon Sep 18, 2006 6:46 pm
MinGW has about the worst site for downloading their package. I had to read through it several times to find what I wanted the first time.
#103060 - Plystire - Mon Sep 18, 2006 11:48 pm
Thanks for the replies, everyone.
I am not an entire novice to programming, I've had several projects finished in other languages, but just to get into console development, I wanted to try making games for the GBA.
I tried several different methods for setting up an environment for this, but none of them worked.
So, what I want is the package designed for the GBA. I'll try getting that devkitPro and see how well it works for me =)
Thanks again guys, I'll keep posted if anything else arises.
~PlystirE~
P.S. I'm a "he", lol
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103063 - Plystire - Mon Sep 18, 2006 11:54 pm
http:\\www.devkitpro.org\
Hmmm, it seems I've already been to this site. I was a little confused with what I should be downloading, it talks about updaters and having to the current updater to get the latest stuff, but I don't have an updater =(
Can someone help me find what it is that I'm supposed to be downloading? Last time I was here I downloaded the devkitARM, which didnt seem to help me with anything.
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103064 - tepples - Mon Sep 18, 2006 11:55 pm
Try downloading the updater itself. Despite the name, it will work even if you don't already have devkitPro installed.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#103065 - Plystire - Tue Sep 19, 2006 12:04 am
Ah, that worked! =D
The updater got several internal errors during the downloading process, but I got it to work after several re-runs of the updater.
Thank you, tepples
[EDIT]
I just tried to make some simple C code and got this back from Programmer's Notepad.
> "make"
"make": *** No targets specified and no makefile found. Stop.
> Process Exit Code: 2
='/
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103066 - keldon - Tue Sep 19, 2006 12:11 am
http://www.eng.hawaii.edu/Tutor/Make/
This document will explain so much information in so little words.
#103068 - Plystire - Tue Sep 19, 2006 12:32 am
Okay, I ran trhough all that and made the Makefile.
Now when I try to compile I get this:
> "make"
gcc -c Hello.c
c:\Program Files\GBADev\armgcc\gcc.exe: *** conflicting versions of cygwin1.dll detected. Use only the most recent version.
"make": *** [Hello.o] Error 5
> Process Exit Code: 2
> Time Taken: 00:16
As far as I am aware, I only HAVE one version of that dll on my computer.
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103076 - tepples - Tue Sep 19, 2006 1:27 am
If you are compiling for a GBA target, your makefile should be using arm-eabi-gcc not gcc. If you're new to this, you might want to try using the makefile template that comes with the libgba examples.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#103160 - thegamefreak0134 - Tue Sep 19, 2006 5:37 pm
Make sure also that any tutorial makefiles you are looking at are targeting DevKitPro, and not DevKitAdv, which is the older version of the package. Unfortunately the makefiles lose compatability between the versions. This is what it looks like you\'re trying to do anyway. I personally prefer DevkitAdv (because I got it to work first) but you should go for the Pro because that\'s what everyone else here uses.
-gamefreak
_________________
What if the hokey-pokey really is what it's all about?
[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]
#103211 - Plystire - Wed Sep 20, 2006 12:09 am
tepples wrote: |
If you are compiling for a GBA target, your makefile should be using arm-eabi-gcc not gcc. If you're new to this, you might want to try using the makefile template that comes with the libgba examples. |
Thank you for pointing out the examples... I got some things to compile and work the way I expected them to. =D
~PlystirE~
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103233 - Plystire - Wed Sep 20, 2006 3:54 am
Alright, So this is more complicated than I first anticipated. =(
I looked through some documentation on the gbadev.org site and found the "Crash Course" tutorial. However, even the supplied code won't compile. It gives me an error about "undefined reference to `main'"
Far be it from me to understand what PN's definition is for that error. In C++ whenever I saw that it meant I had a logical error in the vicinity of the part of code I had been working in.
Can someone "recommend" a tutorial for me? I'm looking through these and follow them in my head, I understand what they mean and their logic behind it, but if I can't get the code that the tutorial is supplying me with to compile, then how am I to believe that what they say is true???
God, I'm so lost -_-;;
~PlystirE~
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103243 - Plystire - Wed Sep 20, 2006 6:59 am
This is just insane...
Why is it that every tutorial is recommending a different environment for usage? This is a completely denormalized way of trying to teach someone to program.
I feel like a little kid going to school where each day the teacher tells him to scrap everything he did yesterday and install something else because TODAY'S lesson won't compile the way yesterday's lesson did.
Is there some sort of way for me to learn how to do this without sorting through masses of tutorials for one that uses the same setup that I have? Or at least a group of tutorials that use the same setup?
My setup is as follows (I think... I'm not too sure, since I've installed several different things in an attempt to make a working environment):
devkitARM (Downloaded because the "Read First" recommended that it be installed)
devkitPro Updater, and everything it downloaded for me (as per the recommendation... this has allowed me to at least compile and run "Hello World")
Programmer's Notepad (The updater gave me this... it hasn't given me too many issues. I assume everything is the Makefile's fault)
I'm programming in C... because I hate assembly, BASIC is too weak, and from what the FAQ said C++ won't be as fast as C.
Using that setup, what should I be looking at in order to further what I "think" I've learned thus far?
I really don't like the way things are looking for me. I can sit and read a tutorial until the cows come home, but in the end if I can't even get a 20 line program to compile because every tutorial I've read wants a different setup, what do i have to show for it?!
Can someone please answer my call for assistance?
Completely lost and feeling alone,
~PlystirE~
<=(
PS - Sorry for the triple post, but I felt that this couldn't be just an edit.
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103247 - Sausage Boy - Wed Sep 20, 2006 8:15 am
That's a great setup. If any guides recommend something else, they're probably old. As for C being faster than C++... Let's just say that the subject could be discussed for weeks, and no one involved would ever change their opinion. I recommend C++, even if it's slower you're code will probably end up more readable. But, you can learn C first and then move onto C++ when/if you feel ready.
Can you compile the examples included in devkitPro?
_________________
"no offense, but this is the gayest game ever"
#103255 - Plystire - Wed Sep 20, 2006 10:47 am
I can compile SOME of the examples... actually three of them.
The scrolling text and the two that have Hello World in them.
I know how to code in C++ but I really just don't seem to see the difference if I can't get my hands on VC++, I might as well use C.
I think my main issue is the Makefile... I've seen some tutorials use some command called "arm-eiab-gcc" or something like that but my compiler doesn't recognise it. So right there, I'm stuck. Also, I dont see any tutorials that duscuss the tools and header files provided by devkitPro. Unless I've overlooked some, that is. O_O
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103264 - Cearn - Wed Sep 20, 2006 1:39 pm
The main problem is that most of the tutorials are very old. Like 3 to 5 years old. The standard was DevKitAdv (DKA)back then, so that's what everyone used including the tutorial writers. Then devkitArm (which is now part of devkitPro (DKP)) came along and essentially took over once DevKitAdv wasn't updated anymore either, while devkitArm continues to be upgraded and improved. The only tutorials that have been updated since then are new PERN (up to DKP r18), and Tonc (up to DKP r19). Use those instead of the older ones.
The exact tools with which to build don't really matter, though, code itself is (mostly) independent of the toolchain. What does change is the path and the name of prefix of the tools (arm-agb-elf-gcc (DKA), arm-elf-gcc (DKP <r19), arm-eabi-gcc (DKP >=r19), etc) and maybe the '-specs' linker flag. Switching between toolchains require only minor changes in makefiles, so they aren't discussed very much. Examine what you have, look at what you need and apply the changes to make it happen.
#103310 - Plystire - Wed Sep 20, 2006 10:04 pm
Okay, then since the eabi doesn't work for me I had assumed I was working with r18, but now when I alter my Makefile to what you've described above, the compiler tells me.
arm-elf-gcc -mthumb-interwork -c first.c
"make": arm-elf-gcc: Command not found
"make": *** [build] Error 127
is there something wrong with that line?
This is what my Makefile looks like right now:
[begin Makefile]
PROJ= first
CC= arm-elf-gcc
OBJCOPY= arm-elf-objcopy
.PHONY : build
build :
$(CC) -mthumb-interwork -c $(PROJ).c
$(CC) -specs=gba_mb.specs -mthumb-interwork $(PROJ).o -o $(PROJ).elf
$(OBJCOPY) -v -O binary $(PROJ).elf $(PROJ).mb.gba
gbafix $(PROJ).gba
.PHONY : clean
clean :
@rm -fv $(PROJ).o
@rm -fv $(PROJ).gba
@rm -fv $(PROJ).elf
[end Makefile]
The only thing I changed from the tutorial was chainging the "eabi" to "elf"
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103318 - Cearn - Wed Sep 20, 2006 10:48 pm
Plystrire wrote: |
"make": arm-elf-gcc: Command not found |
This either means you don't have r18 after all, or that the path to devkitPro's 'bin' directory isn't in the path, or both. The first issue can be resolved by looking in devkitArm's 'bin' directory.
It's probably the path thing, though. The devkitPro installer adds the the 'msys/bin' to the system path and (I think) 'devkitArm', but not devkitArm's 'bin' directory, which is why it can't find the tools. There are several ways of making it work: you could add it to the system path yourself, or add the following line to the makefile:
Code: |
export PATH := $(DEVKITARM)/bin:$(PATH)
|
That should do the trick.
#103322 - Plystire - Wed Sep 20, 2006 11:03 pm
It most likely is the PATH variable, since I just looked into the bin dir and found, Lo and behold, "arm-eabi-gcc.exe"
I changed the Environment variable "Path" to include the devkitARM\bin directory, however PN still doesn't recognise the "arm-eabi-gcc" command.
Is there possibly some other reason for this not working?
(Why does it feel like everyone but me had no problems getting set up? =/ )
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103325 - Plystire - Wed Sep 20, 2006 11:15 pm
Alright, it looks like PN just needed a reboot. It recognises the command now, however, something's happening that doesn't give me a "detailed" error for.
arm-eabi-gcc -mthumb-interwork -c First.c
arm-eabi-gcc -specs=gba_mb.specs -mthumb-interwork First.o -o First.elf
arm-eabi-objcopy -v -O binary First.elf First.mb.gba
copy from `First.elf' [elf32-littlearm] to `First.mb.gba' [binary]
gbafix First.gba
Error opening input file!
Input file? what other input files could it be talking about? Is there a tool that I haven't given a path for?
_________________
I-am-so-smart.
S-M-R-T... smart. Got it? Good =3
#103329 - Cearn - Wed Sep 20, 2006 11:25 pm
Plystire wrote: |
(Why does it feel like everyone but me had no problems getting set up? =/ ) |
Trust me, you're not :P
Anyway, it seems that sometimes the environment variables don't kick in until you open and close the app you were working in. Spaces in the path can also cause an awful lot of trouble.
....
Damn you and your ninja skills. Anyway,
Plystire wrote: |
Code: | arm-eabi-gcc -mthumb-interwork -c First.c
arm-eabi-gcc -specs=gba_mb.specs -mthumb-interwork First.o -o First.elf
arm-eabi-objcopy -v -O binary First.elf First.mb.gba
copy from `First.elf' [elf32-littlearm] to `First.mb.gba' [binary]
gbafix First.gba
Error opening input file! |
Input file? what other input files could it be talking about? Is there a tool that I haven't given a path for? |
No, that's my bad. Notice that gbafix's input is first.gba, while the rest actually builds for first.mb.gba. I changed it to a multiboot build recently and I guess I didn't update all of the commands, sowwy.
Also, [code] [/code] tags let you create a block of fixed-width font text for code, etc. Might look nicer that way.