Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for miyoo faild #44

Closed
jeason1997 opened this issue Dec 7, 2023 · 4 comments
Closed

Build for miyoo faild #44

jeason1997 opened this issue Dec 7, 2023 · 4 comments

Comments

@jeason1997
Copy link

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
Copy link
Owner

bardeci commented Dec 7, 2023

-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
Copy link
Owner

bardeci commented Dec 10, 2023

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

@jeason1997
Copy link
Author

-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
Copy link
Owner

bardeci commented Dec 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants