Error during linking examples
salva00 opened this issue · comments
Hi, I've tried to compile some of your examples (sprites and windows) but when I tried to compile this error happened :
linking cartridge
/opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/12.1.0/../../../../arm-none-eabi/bin/ld: bn_hw_audio.bn_noflto.o: in function `bn::hw::audio::init(void (*)(), void (*)())':
/Users/usr/Documents/gbadev/butano-10.3.0/butano/hw/src/bn_hw_audio.bn_noflto.cpp:200: undefined reference to `_bn_audio_soundbank_bin'
collect2: error: ld returned 1 exit status
make[2]: *** [/Users/usr/Documents/gbadev/butano-10.3.0/examples/windows/windows.elf] Error 1
make[1]: *** [build] Error 2
make: *** [all] Error 2
I'm using MacOS Monterey 12.4 with devkitproARM updated at the latest version. How can I fix this?
Have you tried to clean the project (make clean
) before building it?
Yep but nothing changed :/
Weird, both examples build and run on my machine without issues (Windows 10, both Butano and devkitARM updated to the latest version).
Are present these files in the build
folder of the example you are trying to build?
_bn_audio_soundbank.bin
_bn_audio_soundbank.bin.o
_bn_audio_soundbank_bin.h
In build
folder is only missing _bn_audio_soundbank_bin.h
Weird, if _bn_audio_soundbank.bin
and _bn_audio_soundbank.bin.o
are present, there should not be link issues.
Does audio
example work?
no, it gives me the same error
Are you able to build the maxmod example from devkitARM, like the install guide suggests? https://gvaliente.github.io/butano/getting_started.html#getting_started_devkitARM
if I try to compile maxmod example from this example, it doesn't compile : fatal error: soundbank_bin.h: No such file or directory
:/
It seems you have a devkitARM issue then, sorry.
I've just reinstalled devkitARM and now works, thanks for the support :)
This may have happened because of an error in a devkitARM makefile rule:
define bin2o
bin2s -a 4 -H `(echo $(<F) | tr . _)`.h $< | $(AS) -o $(<F).o
endef
If bin2s
is not installed, then this rule will silently fail, and you'll get the link error in this bug.