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 > confused about programmers notepad

#153250 - Mazdaplz - Thu Mar 27, 2008 12:54 am

ok, so i was sailing full speed when i compiled the hello world example that came as a template with devkitpro.

i kept on going with the tonc tutorial. i grabbed the code and replaced template.c with the code from the 3 pixels example. you know, this one:

Code:
int main()
{
    *(unsigned int*)0x04000000 = 0x0403;

    ((unsigned short*)0x06000000)[120+80*240] = 0x001F;
    ((unsigned short*)0x06000000)[136+80*240] = 0x03E0;
    ((unsigned short*)0x06000000)[120+96*240] = 0x7C00;

    while(1);

    return 0;
}


pretty straightforward. i did not touch the makefile.
i had no problems compiling, but i couldnt save it as template, i needed a new filename.
i made a new folder in C: (c:\prog) and i put a copy of the makefile there,
then i made a new file called first.c (as in first gba rom, which is the name of this example).
i made a whole new group project called first.pnproj, and a new project inside of it called first. i added the makefile to the project and a new folder called source, where i dropped first.c

it seemed like an exact copy of the template that had worked, only on some other folder and with another name (first instead of template).
pressed alt+1 and on compile i got this error:

"no rules to make first.c needed by first.o" (or something very similar, i kinda erased that project so i don't have the actual message but it's pretty close)

how come???

i really dont understand programmer's notepad 2, im guessing it has something to do with the name of the .pnproj or the folder which it is in, otherwise it should work perfectly.

i opened template.pnproj again; i erased the contents of template.c for the second time and added the code that i posted. it worked...

if i scratch my head any harder i will touch my brain. what should i do :(

it's funny i have been struggling with programmers notepad instead of actual code. i have yet to write a single line of my own

i guess i can compile anything as long as it's called 'template'

EDIT: ok i recovered the exact error message (mostly)

"No rule to make target first.c, needed by first.o, stop"

#153259 - Mazdaplz - Thu Mar 27, 2008 8:09 am

ok, so reading further into the tonc guide i realise than this is a long way from the old mono gb days that i felt so comfortable with (gba is WAY closer to snes than gb or gbc it would seem).
i think given the circumstances i understood a surprising ammount of the document, but it made me wish i had sticked to programming as a profession instead of becoming an artist. you probably dont need a degree to make something out of it, but i think i could probably go and learn something like C# and XNA toolkit somewhat faster from scratch (maybe im wrong though).
it seems to me that this set of tools is more appropiate for the technical type of person that likes working with hardware, enjoys mathematics and isn't even a little bit rusty on his programming.

for all these reasons (and the fact that i can't even set up the tools without more problems than i should have) i have decided to give HAM a try.
might also work with the ancient mono gb again (or even gbc) for a little nostalgia;
if i ever come back to using devkitpro in the near future im probably going to use it for a text based game like a remake of dopewars.

i am sorry to have wasted your time everyone, especially wintermute and thanks for all the help.
so long.

-maz

#153263 - Cearn - Thu Mar 27, 2008 11:17 am

Mazdaplz wrote:

"no rules to make first.c needed by first.o" (or something very similar, i kinda erased that project so i don't have the actual message but it's pretty close)

An error like this can happen if you move a project or rename its files. Try `make clean' before building again.

The technical reason for this is that the makefiles create a dependency list. foo.o depends on foo.c, which depends on foo.h/bar.h etc (see the .d files in the build directory). Renaming things and rebuilding without cleaning throws off the dependencies, as some of the files won't exist anymore.

This is a makefile quirk and has nothing to do with the editor itself.

#153276 - SiW - Thu Mar 27, 2008 5:07 pm

Cearn wrote:
Try `make clean' before building again.


And you can do that with Alt + 2 in Programmer's Notepad with the default key settings.

#153281 - silent_code - Thu Mar 27, 2008 6:13 pm

once you get it (shouldn't take you any long), the gba/nds is a GREAT piece of hardware by design! it has it's quirks, sure, but that's anything big.

installing the tools shouldn't be that hard either. i don't know about PN, but the devkit workes well from commandline and code::blocks.

you should really try a clean build!
good luck and happy coding!