• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Can't compile PokeRuby or PokeEmerald at all...at all

  • 58
    Posts
    13
    Years
    • Seen Oct 12, 2024
    Hi,

    It may seems like a noob question, but each time I use Cygwin to build PokeRuby or PokeEmerald (haven't tried with PokeFireRed), I get the following errors even with EVERYTHING installed from the tutorial;

    "
    $ make ruby
    convert_png.c:5:10: fatal error: png.h : No such file or directory
    #include <png.h>

    make[2]: *** [Makefile:18: gbagfx] Error 1
    make[1]: *** [Makefile:176: tools] Error 2
    gcc -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c -o gbagfx -lpng -lz
    /bin/bash: tools/scaninc/scaninc.exe: No such file or directory
    "
    Apparently I'm missing a file called scaninc.exe, but I searched everywhere and couldn't find it, so I'm stuck with just a few edits to the decomp project and unable to test them... can anyone help?
     
    Hi,

    It may seems like a noob question, but each time I use Cygwin to build PokeRuby or PokeEmerald (haven't tried with PokeFireRed), I get the following errors even with EVERYTHING installed from the tutorial;

    "
    $ make ruby
    convert_png.c:5:10: fatal error: png.h : No such file or directory
    #include <png.h>

    make[2]: *** [Makefile:18: gbagfx] Error 1
    make[1]: *** [Makefile:176: tools] Error 2
    gcc -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c -o gbagfx -lpng -lz
    /bin/bash: tools/scaninc/scaninc.exe: No such file or directory
    "
    Apparently I'm missing a file called scaninc.exe, but I searched everywhere and couldn't find it, so I'm stuck with just a few edits to the decomp project and unable to test them... can anyone help?
    You seem to be missing libpng, not scaninc.
    On Cygwin, you need to install the package called libpng-devel, so make sure that's the one you have.
     
    You seem to be missing libpng, not scaninc.
    On Cygwin, you need to install the package called libpng-devel, so make sure that's the one you have.

    I checked, and I already have everything... I just wanted to generate a Ruby/Sapphire/Emerald without the fishing rod reeling then edit the game with another software thanks to its "what you see is what you get".
     
    I checked, and I already have everything... I just wanted to generate a Ruby/Sapphire/Emerald without the fishing rod reeling then edit the game with another software thanks to its "what you see is what you get".

    then uninstall undo everything and try a different method, I was able to do it with the msys2 method so try that instead.
     
    Thanks pal! It worked! But now I can't find the pokeruby folder on my PC after using Msys2... :)

    lol yeah, its mysterious at first, but if you did it just like the guide, it should put the romfolder and the agbcc folder right under your user folder.

    C:/Users/yourusername/

    they should both be right there. :)

    but the simplest thing is to just search the name ( pokeruby) in the windows search bar.

    also quick tip I found, msys2 uses a different short cut for pasting, so to speed things up, you can paste anything you've copied with
    Shift+insert
     
    Last edited:
    lol yeah, its mysterious at first, but if you did it just like the guide, it should put the romfolder and the agbcc folder right under your user folder.

    C:/Users/yourusername/

    they should both be right there. :)

    but the simplest thing is to just search the name in the windows search bar.

    Thanks! Found them! Now to test if it builds correctly ;)
     
    Ok. While trying to test PokeEmerald, I get the following errors:

    In file included from include/gba/gba.h:4,
    from src/agb_flash.c:1:
    include/gba/defines.h:4:10: fatal error: stddef.h: No such file or directory
    4 | #include <stddef.h>
    | ^~~~~~~~~~
    compilation terminated.
    make[2]: *** [Makefile:151: build/src/agb_flash.o] Error 1
    make[1]: *** [Makefile:169: payload] Error 2
    make: *** [Makefile:345: berry_fix] Error 2

    I didn't touched those files, as I only edited the shops items as well as the ''No Reeling while Fishing'' script, so I'm wondering what I did wrong. Likewise, trying to compile PokeRuby, it give me these errors:

    sed -e "s#tools/#../../tools/#g" ld_script.txt >build/ruby/ld_script.ld
    arm-none-eabi-cpp -iquote include -Werror -Wno-trigraphs -D RUBY -D REVISION=0 -D ENGLISH -D=DEBUG_FIX0 -D DEBUG=0 -D MODERN=0 -I tools/agbcc/include -nostdinc -undef src/bard_music.c -o build/ruby/src/bard_music.i
    In file included from src/bard_music.c:1:
    include/global.h:4:10: fatal error: string.h: No such file or directory
    4 | #include <string.h>
    | ^~~~~~~~~~
    compilation terminated.
    make[1]: *** [Makefile:206: build/ruby/src/bard_music.o] Error 1
    make: *** [Makefile:219: ruby] Error 2


    I'm using MSys2, by the way.
     
    by the way.

    Yeah 100% what lunos said, I got the same error first time i tried.

    Now here's what you need to do.

    Is just rerun these commands in order and you should be golden.

    cd agbcc
    ./build.sh
    ./install.sh ../pokeruby (or ./install.sh ../pokeemerald)
    cd ../pokeruby (or cd ../pokeemerald)
    make -jN (where N is the number of cpu threads, depends on what your computer can handle etc. I'd say try between 1-50. I used 100 without issue but I have a gaming pc)

    make sure you're in your root directory when you start that list of commands there, if you're unsure where you are, just put in cd and press enter, to take you back to the root.

    Then just run the command list from there.
     
    Yeah 100% what lunos said, I got the same error first time i tried.

    Now here's what you need to do.

    Is just rerun these commands in order and you should be golden.

    cd agbcc
    ./build.sh
    ./install.sh ../pokeruby (or ./install.sh ../pokeemerald)
    cd ../pokeruby (or cd ../pokeemerald)
    make -jN (where N is the number of cpu threads, depends on what your computer can handle etc. I'd say try between 1-50. I used 100 without issue but I have a gaming pc)

    make sure you're in your root directory when you start that list of commands there, if you're unsure where you are, just put in cd and press enter, to take you back to the root.

    Then just run the command list from there.

    Thanks you guys! It works! But I have another problem... Each time I try to instert NobodysSociety's script to prevent reeling the rod while fishing in PokeEmerald, I get these;

    build/emerald/src/field_player_avatar.i:9506: error: invalid encoding in UTF-8 string
    src/field_player_avatar.c: In function `Fishing_ShowDots':
    src/field_player_avatar.c:1784: syntax error at end of input
    agbcc: warnings being treated as errors
    src/field_player_avatar.c:128: warning: `Fishing_CheckForBite' used but never defined
    src/field_player_avatar.c:129: warning: `Fishing_GotBite' used but never defined
    src/field_player_avatar.c:130: warning: `Fishing_WaitForA' used but never defined
    src/field_player_avatar.c:131: warning: `Fishing_CheckMoreDots' used but never defined
    src/field_player_avatar.c:132: warning: `Fishing_MonOnHook' used but never defined
    src/field_player_avatar.c:133: warning: `Fishing_StartEncounter' used but never defined
    src/field_player_avatar.c:134: warning: `Fishing_NotEvenNibble' used but never defined
    src/field_player_avatar.c:135: warning: `Fishing_GotAway' used but never defined
    src/field_player_avatar.c:136: warning: `Fishing_NoMon' used but never defined
    src/field_player_avatar.c:137: warning: `Fishing_PutRodAway' used but never defined
    src/field_player_avatar.c:138: warning: `Fishing_EndNoMon' used but never defined
    src/field_player_avatar.c:139: warning: `AlignFishingAnimationFrames' used but never defined
    make: *** [Makefile:256: build/emerald/src/field_player_avatar.o] Error 1

    I dunno what's causing this, though...
     
    Thanks you guys! It works! But I have another problem... Each time I try to instert NobodysSociety's script to prevent reeling the rod while fishing in PokeEmerald, I get these;

    build/emerald/src/field_player_avatar.i:9506: error: invalid encoding in UTF-8 string
    src/field_player_avatar.c: In function `Fishing_ShowDots':
    src/field_player_avatar.c:1784: syntax error at end of input
    agbcc: warnings being treated as errors
    src/field_player_avatar.c:128: warning: `Fishing_CheckForBite' used but never defined
    src/field_player_avatar.c:129: warning: `Fishing_GotBite' used but never defined
    src/field_player_avatar.c:130: warning: `Fishing_WaitForA' used but never defined
    src/field_player_avatar.c:131: warning: `Fishing_CheckMoreDots' used but never defined
    src/field_player_avatar.c:132: warning: `Fishing_MonOnHook' used but never defined
    src/field_player_avatar.c:133: warning: `Fishing_StartEncounter' used but never defined
    src/field_player_avatar.c:134: warning: `Fishing_NotEvenNibble' used but never defined
    src/field_player_avatar.c:135: warning: `Fishing_GotAway' used but never defined
    src/field_player_avatar.c:136: warning: `Fishing_NoMon' used but never defined
    src/field_player_avatar.c:137: warning: `Fishing_PutRodAway' used but never defined
    src/field_player_avatar.c:138: warning: `Fishing_EndNoMon' used but never defined
    src/field_player_avatar.c:139: warning: `AlignFishingAnimationFrames' used but never defined
    make: *** [Makefile:256: build/emerald/src/field_player_avatar.o] Error 1

    I dunno what's causing this, though...

    Well the reason is right there, in the warning.

    Ok so since the main goal of this thread is solved, you should really open a new thread for this issue,
    and take a look at some tutorials on the basics of working with decomps.

    But I'll give you a simple answer for now. (can't really go more in-depth since I'm new to decomp too, most of my work has been in binary or cfru, I made my first decomp literally yesterday.)

    When working with C files everything has to be "defined" somewhere (in one of the files in the repository [ i.e in a file in one of the folders in your pokeemerald folder] that tells the compiler what it means/is referring to.

    But on top of that you must also "include" that file where its defined at the top of every file where a portion of that code is being referenced.

    Just think of it like this, There's nothing wrong with your code, (since its a fresh install).
    If the reeling thing is known to work, then there's also nothing wrong with the code you're trying to apply.

    So you're just missing the instructions on how to properly apply it, but because the first 2 things are true, there's no reason you shouldn't be able to find the solution.
    (In case this is misunderstood, that was my attempt at motivation, to assure you you can do it. )



    If Lunos is still stopping by, please clear up anything I may have said wrong here about defines and includes.




    almost missed it but this part...

    src/field_player_avatar.c:1784: syntax error at end of input

    go to that file and check line 1784. if you have notepad +

    use ctrl g. take a look at the line and see what's going on there, or make sure you add that line as a screenshot in your next help post
    because people will definitely want to see it.
     
    Back
    Top