Nintendo DS Lite

解決"failed to open input file: /opt/devkitpro/libnds/default.elf"問題


問題如下:

linking audio_modes.elf
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: warning: nds-examples/audio/maxmod/audio_modes/audio_modes.elf has a LOAD segment with RWX permissions
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: warning: nds-examples/audio/maxmod/audio_modes/audio_modes.elf has a LOAD segment with RWX permissions
ndstool -c nds-examples/audio/maxmod/audio_modes/audio_modes.nds -9 nds-examples/audio/maxmod/audio_modes/audio_modes.elf -b /opt/devkitpro//libnds/icon.bmp "audio_modes;built with devkitARM;http://devkitpro.org" 
Nintendo DS rom tool 2.2.0 - Dec 15 2022
by Rafael Vuijk, Dave Murphy, Alexei Karpenko
failed to open input file: '/opt/devkitpro//libnds/default.elf'
make[4]: *** [/opt/devkitpro/devkitARM//ds_rules:38: nds-examples/audio/maxmod/audio_modes/audio_modes.nds] Error 1
make[3]: *** [Makefile:114: build] Error 2
make[3]: Leaving directory 'nds-examples/audio/maxmod/audio_modes'
make[2]: *** [Makefile:3: all] Error 1
make[2]: Leaving directory 'nds-examples/audio/maxmod'
make[1]: *** [Makefile:3: all] Error 1
make[1]: Leaving directory 'nds-examples/audio'
make: *** [Makefile:13: examples] Error 1

因為ndstool有一個預設的ARM7 EFL路徑(default.elf)

/*
 * GetDefaultArm7
 * Retrieves the path to the default homebrew ARM7 component
 */
void GetDefaultArm7(char* buffer, size_t size)
{
    char *devkitProPATH;
    devkitProPATH = getenv("DEVKITPRO");

    #ifdef __WIN32__
    // convert to standard windows path
    if ( devkitProPATH && devkitProPATH[0] == '/' ) {
        devkitProPATH[0] = devkitProPATH[1];
        devkitProPATH[1] = ':';
    }
    #endif

    if (!devkitProPATH) {
        fprintf(stderr,"No arm7 specified and DEVKITPRO missing from environment!\n");
        exit(1);
    }

    strncpy(buffer, devkitProPATH, size);
    strncat(buffer, "/libnds/default.elf", size);
}

但是預設的ds_rules(/opt/devkitpro/devkitARM/ds_rules)卻只有ARM9路徑

36 #---------------------------------------------------------------------------------
37 %.nds: %.elf
38     ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES)
39     $(SILENTMSG) built ... $(notdir $@)

因此,只要添加ARM7路徑(-7 $<)就可以

36 #---------------------------------------------------------------------------------
37 %.nds: %.elf
38     ndstool -c $@ -9 $< -7 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES)
39     $(SILENTMSG) built ... $(notdir $@)


返回上一頁