Render96 / Render96ex

Fork of https://github.com/sm64-port/sm64-port with additional features.
245 stars 43 forks source link

Won't compile on macOS (arm64) #78

Closed halpz closed 1 year ago

halpz commented 1 year ago

Describe the bug the build will start, assets are extracted, then it fails here: n64graphics_ci_dir/exoquant/exoquant.c:28:10: fatal error: 'malloc.h' file not found

To Reproduce Steps to reproduce the behavior:

  1. Clone repo
  2. copy baserom
  3. run gmake OSX_BUILD=1 BETTERCAMERA=1 EXTERNAL_DATA=1 NODRAWDISTANCE=1

Expected behavior Should build

Desktop (please complete the following information): -Macos 13.3.1 (M1 MacBook Pro)

halpz commented 1 year ago

if I comment out the #include <malloc.h> and try again, I get:

aiff_extract_codebook.c:48:16: error: call to undeclared library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, __builtin_va_list)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    int size = vsnprintf(NULL, 0, fmt, ap);
               ^
aiff_extract_codebook.c:48:16: note: include the header <stdio.h> or explicitly provide a declaration for 'vsnprintf'

Does anyone have any clear build steps for MacOS?

halpz commented 1 year ago

I managed to fix this by using the alpha branch, the master branch will not build

tonyb486 commented 4 months ago

I got a similar error on tools/aiff_extract_codebook.c on arm64 mac.

Fixed that by adding:

define _C99_SOURCE

to the top.