Razakhel / RaZ

Modern & multiplatform 3D game engine in C++17

Home Page:http://razakhel.github.io/RaZ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined symbols for png neno api on mac m1

wangcan26 opened this issue · comments

[ 65%] Linking CXX executable RaZ_BloomDemo
Undefined symbols for architecture arm64:
"_png_do_expand_palette_rgb8_neon", referenced from:
_png_do_read_transformations in libRaZ.a(pngrtran.c.o)
"_png_do_expand_palette_rgba8_neon", referenced from:
_png_do_read_transformations in libRaZ.a(pngrtran.c.o)
"_png_init_filter_functions_neon", referenced from:
_png_read_filter_row in libRaZ.a(pngrutil.c.o)
"_png_riffle_palette_neon", referenced from:
_png_do_read_transformations in libRaZ.a(pngrtran.c.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Platform: Mac M1 Pro
OS: Ventura 13.0.1

Hey and thanks for this issue!

Indeed, I've never tried building RaZ on a Mac myself, and even less so with an Arm CPU. I do see these functions (although not prepended by a _) in the most recent version of libpng; I probably mistakenly removed those files on my side. I'll try to update to the latest version while making sure all needed files are present in the coming days

I just add add_definitions(-DPNG_ARM_NEON_OPT=0) in cmake to disable optimization of png, i think this optimization only can be used on mobile platform.

Interesting, I'll investigate that and add this definition or find a workaround. I hope it doesn't introduce any weird behavior on your side, please keep me posted if it does!