bardeci / gambatte-dms

Gambatte-DMS is a GB/GBC emulator for handheld devices, using a modified Gambatte core.
GNU General Public License v2.0
66 stars 21 forks source link

Build for miyoo faild #44

Closed jeason1997 closed 8 months ago

jeason1997 commented 9 months ago

I tried building the project using the miyoo toolchain but encountered an error:

c++ -lasound -lmodplugma -lmikmod -Wl,--as-needed -Wl,--gc-sections -flto -s -Wl,--end-group /opt/miyoo/lib/gcc/arm-miyoo-linux-uclibcgnueabi/7.3.0/../../../../arm-miyoo-linux-uclibcgnueabi/bin/ld: cannot find -lmodplugma /opt/miyoo/lib/gcc/arm-miyoo-linux-uclibcgnueabi/7.3.0/../../../../arm-miyoo-linux-uclibcgnueabi/bin/ld: cannot find -lmikmod /opt/miyoo/lib/gcc/arm-miyoo-linux-uclibcgnueabi/7.3.0/../../../../arm-miyoo-linux-uclibcgnueabi/bin/ld: cannot find -lmodplugma /opt/miyoo/lib/gcc/arm-miyoo-linux-uclibcgnueabi/7.3.0/../../../../arm-miyoo-linux-uclibcgnueabi/bin/ld: cannot find -lmikmod collect2: error: ld returned 1 exit status make: *** [common.mk:83: executable] Error 1

According to the error message, it seems that the miyoo SDK is missing these two linked libraries: -lmodplugma and -lmikmod. Could you provide an SDK that can be compiled successfully, or the files for these two linked libraries? Thank you very much.

and this is my makefile `CHAINPREFIX=/opt/miyoo CROSS_COMPILE=$(CHAINPREFIX)/bin/arm-miyoo-linux-uclibcgnueabi-

CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ SYSROOT := $(CHAINPREFIX)/arm-miyoo-linux-uclibcgnueabi/sysroot SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)

OUTPUTNAME = gambatte-dms-pocketgo

DEFINES = -DHAVE_STDINT_H -DVERSION_POCKETGO INCLUDES = -Isrc/gambatte_sdl -Ilibgambatte -Icommon -Iinclude -Ilibgambatte/include -Ilibgambatte/src $(SDL_CFLAGS) OPT_FLAGS = -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto EXTRA_LDFLAGS = -lasound -lmodplugma -lmikmod -Wl,--as-needed -Wl,--gc-sections -flto -s

include common.mk `

bardeci commented 9 months ago

-lmodplugma? shouldn't it be -lmodplug?

about the toolchain, i believe i'm using an older one, but i cannot recall which exact version. You could try with this one: https://github.com/bittboy/buildroot

Anyway, and before you try a different toolchain, you can try just removing the references to those libraries from your makefile and from common.mk. There is a chance that i used another makefile as a template and those libraries slipped in. So those libraries might not be needed at all.

bardeci commented 9 months ago

I checked and those libraries are needed. So try a different toolchain.

jeason1997 commented 8 months ago

-lmodplugma? shouldn't it be -lmodplug?

about the toolchain, i believe i'm using an older one, but i cannot recall which exact version. You could try with this one: https://github.com/bittboy/buildroot

Anyway, and before you try a different toolchain, you can try just removing the references to those libraries from your makefile and from common.mk. There is a chance that i used another makefile as a template and those libraries slipped in. So those libraries might not be needed at all.

Thank you for your response. Following your advice, I commented out -lmodplugma and -lmikmod in both the Makefile and common.mk. After doing so, the compilation was successful using arm-miyoo-linux-uclibcgnueabi. I'm curious to know if removing these two libraries will affect the game's music.

bardeci commented 8 months ago

If it compiles without errors, then it will work. Apparently some toolchains don't need those libraries to be referenced. No idea why.

On the bittboy toolchain i'm using, i need to reference them, otherwise i got errors. But on the opendingux toolchain i'm using, i don't need to reference those libraries. Same goes for other libraries, it seems every single toolchain has its own set of shenanigans.