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

Issue linking gbt_player when running makefile on macOS #37

Open
martzgb opened this issue Dec 2, 2021 · 3 comments
Open

Issue linking gbt_player when running makefile on macOS #37

martzgb opened this issue Dec 2, 2021 · 3 comments

Comments

@martzgb
Copy link

martzgb commented Dec 2, 2021

I've been successfully building/running on macOS for a while now using changes very similar to this pull request: https://github.com/Zal0/ZGB/pull/32/files

However I've recently added music to my game, and I'm noticing this issue:

creating zgb.lib
Linking
?ASlink-Warning-Cannot open library module ../DebugColor/zgb/-e gbt_player.o

?ASlink-Warning-Undefined Global '_gbt_stop' referenced by module 'main'

?ASlink-Warning-Undefined Global '_gbt_enable_channels' referenced by module 'main'

?ASlink-Warning-Undefined Global '_gbt_play' referenced by module 'Music'

?ASlink-Warning-Undefined Global '_gbt_loop' referenced by module 'Music'

?ASlink-Warning-Undefined Global '_gbt_update' referenced by module 'Music'

The culprit seems to be some bad string concatenation with macOS make, where -e is in the wrong place: /zgb/-e gbt_player.o

I was able to work around this by removing the link to $(ZGB_PATH_UNIX)/lib/hUGEDriver.obj.o, and adding an explicitly linking $(OBJDIR_ZGB)/gbt_player.o instead. I can keep my copy of ZGB patched and rebase as new changes come out, since I already do this for gbm2c, gbr2c, and gbr2png binaries... But it would be nice if a fix were incorporated upstream since the makefile seems like fertile ground for merge conflicts.

Screen Shot 2021-12-01 at 4 08 56 PM

@Zal0
Copy link
Owner

Zal0 commented Dec 2, 2021

Hmm... Did you set MUSIC_PLAYER = GBT_PLAYER in your project Makefile?
You can use either GBT_PLAYER or HUGETRACKER and that should do it

@martzgb
Copy link
Author

martzgb commented Dec 2, 2021

I do set that. My current makefile:

PROJECT_NAME = ZGB_TEMPLATE

all: build_gb

N_BANKS = A

DEFAULT_SPRITES_SIZE = SPRITES_8x8

MUSIC_PLAYER = GBT_PLAYER

include $(ZGB_PATH)/src/MakefileCommon

@asturur
Copy link

asturur commented Feb 14, 2024

The way i got rid of The culprit seems to be some bad string concatenation with macOS make, where -e is in the wrong place: /zgb/-e gbt_player.o was to delete the -e in front of the echo command.

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

3 participants