zelda3 icon indicating copy to clipboard operation
zelda3 copied to clipboard

Issues compiling on M2 Mac

Open MMello396 opened this issue 1 year ago • 2 comments

Describe your bug here. And how to reproduce it.

Was going through compiling for my laptop(M2 Mac Air) to play on the go and can not get it to compile following the instructions here on github.

BLUF: I think that i'm either experiancing some sort of mismatch in software versions or it's purely a symtom of trying this on an ARM Mac vs an intel mac.

These is are the issues I ran into while attempting to compile through the terminal: Attempt 1: Followed the guide "to a T" and got this when trying to make:

src/messaging.c:2394:21: error: passing arguments to 'VWF_RenderSingle' without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] VWF_RenderSingle(TEXTCMD_PARAM(cmd)); ^ In file included from src/messaging.c:1: src/messaging.h:110:6: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Werror,-Wdeprecated-non-prototype] void VWF_RenderSingle(); ^ src/messaging.c:2512:6: note: conflicting prototype is here void VWF_RenderSingle(int c) { // 8ecab8 ^ 2 errors generated. make: *** [src/messaging.o] Error 1

What is your build target?

Mac

MMello396 avatar Dec 29 '23 16:12 MMello396

Did you try CFLAGS="-Wno-deprecated-non-protoype" make ? (from: https://github.com/snesrev/zelda3/issues/251)

alexschwarz89 avatar Jan 15 '24 14:01 alexschwarz89

Fixed the issue. Should have dug through the issue history more. Thank you for the pointer!

MMello396 avatar Jan 15 '24 17:01 MMello396

I used folowing one and it works on M2 CPU.

❯ make CC=clang CFLAGS="-O3 -mcpu=apple-m2 -I. $(pkg-config --cflags sdl2) -Wno-error=deprecated-non-prototype"

(Before the build, i've installed python 3.11 via brew and i changed "Makefile" Line 5 with "PYTHON:=/opt/homebrew/bin/python3.11"

mesutschwarz avatar May 18 '25 07:05 mesutschwarz