This is my first time posting on Github so apologies if don't know how things work. I tried to build but it kept erroring out saying the getuid() function in "struct passwd* pw = getpwuid(getuid());" is undefined. I went into ./libplacebo/demos/utils.c and added "#include " inside of "#ifdef PL_HAVE_APPLE" and it fixed the issue.
This is the error I got in terminal when the compile failed:
ninja: Entering directory `./build'
[16/81] Compiling C object demos/colors.p/utils.c.o
FAILED: demos/colors.p/utils.c.o
cc -Idemos/colors.p -Idemos -I../demos -I../3rdparty/Vulkan-Headers/include -Isrc/include -I../src/include -Isrc -I../src -I/opt/homebrew/Cellar/shaderc/2023.6/include -I/opt/homebrew/Cellar/little-cms2/2.15/include -I/opt/homebrew/Cellar/xxhash/0.8.2/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -Wundef -Wshadow -Wparentheses -Wpointer-arith -D_ISOC99_SOURCE -D_ISOC11_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=700 -USTRICT_ANSI -Wmissing-prototypes -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-type-limits -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Wno-missing-braces -Wundef -Wshadow -Wparentheses -Wpointer-arith -DPL_HAVE_PTHREAD '' -MD -MQ demos/colors.p/utils.c.o -MF demos/colors.p/utils.c.o.d -o demos/colors.p/utils.c.o -c ../demos/utils.c
../demos/utils.c:39:34: error: call to undeclared function 'getuid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
struct passwd pw = getpwuid(getuid());
^
../demos/utils.c:39:34: note: did you mean 'getpwuid'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pwd.h:100:16: note: 'getpwuid' declared here
struct passwd getpwuid(uid_t);
^
1 error generated.
[21/81] Compiling C object demos/sdlimage.p/utils.c.o
FAILED: demos/sdlimage.p/utils.c.o
cc -Idemos/sdlimage.p -Idemos -I../demos -I../3rdparty/Vulkan-Headers/include -Isrc/include -I../src/include -I/opt/homebrew/Cellar/shaderc/2023.6/include -I/opt/homebrew/Cellar/little-cms2/2.15/include -I/opt/homebrew/Cellar/xxhash/0.8.2/include -I/opt/homebrew/include/SDL2 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/jpeg-xl/0.8.2_1/include -I/opt/homebrew/Cellar/highway/1.0.7/include -I/opt/homebrew/Cellar/brotli/1.1.0/include -I/opt/homebrew/Cellar/libtiff/4.5.1/include -I/opt/homebrew/opt/zstd/include -I/opt/homebrew/Cellar/xz/5.4.4/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.0/include -I/opt/homebrew/Cellar/libavif/1.0.1/include -I/opt/homebrew/Cellar/webp/1.3.1/include -I/opt/homebrew/Cellar/webp/1.3.1/include/webp -I/opt/homebrew/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -Wundef -Wshadow -Wparentheses -Wpointer-arith -D_ISOC99_SOURCE -D_ISOC11_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=700 -USTRICT_ANSI -Wmissing-prototypes -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-type-limits -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Wno-missing-braces -Wundef -Wshadow -Wparentheses -Wpointer-arith -DHWY_SHARED_DEFINE -DAVIF_DLL -D_THREAD_SAFE -DPL_HAVE_PTHREAD '' -MD -MQ demos/sdlimage.p/utils.c.o -MF demos/sdlimage.p/utils.c.o.d -o demos/sdlimage.p/utils.c.o -c ../demos/utils.c
../demos/utils.c:39:34: error: call to undeclared function 'getuid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
struct passwd pw = getpwuid(getuid());
^
../demos/utils.c:39:34: note: did you mean 'getpwuid'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pwd.h:100:16: note: 'getpwuid' declared here
struct passwd getpwuid(uid_t);
^
1 error generated.
[24/81] Generating src/opengl/include/glad/gl.h with a custom command (wrapped by meson to set env)
[12.09.2023 22:29:39][INFO ][glad ]: getting 'egl' specification from remote location
[12.09.2023 22:29:39][DEBUG ][glad.files ]: intercepted attempt to retrieve resource: 'https://raw.githubusercontent.com/KhronosGroup/EGL-Registry/main/api/egl.xml'
[12.09.2023 22:29:39][INFO ][glad.files ]: opening packaged resource: 'egl.xml'
[12.09.2023 22:29:39][INFO ][glad ]: getting 'gl' specification from remote location
[12.09.2023 22:29:39][DEBUG ][glad.files ]: intercepted attempt to retrieve resource: 'https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/main/xml/gl.xml'
[12.09.2023 22:29:39][INFO ][glad.files ]: opening packaged resource: 'gl.xml'
[12.09.2023 22:29:39][INFO ][glad ]: generating gl:core/gl=None
[12.09.2023 22:29:39][INFO ][glad ]: no explicit version given for api gl, using Version(major=4, minor=6)
[12.09.2023 22:29:39][INFO ][glad ]: generating gles2:None/gl=None
[12.09.2023 22:29:39][INFO ][glad ]: no explicit version given for api gles2, using Version(major=3, minor=2)
[12.09.2023 22:29:39][INFO ][glad ]: merging [FeatureSet(name=gl, info=[gl:core=4.6], extensions=21), FeatureSet(name=gles2, info=[gles2=3.2], extensions=10)]
[12.09.2023 22:29:39][INFO ][glad ]: merged into FeatureSet(name=gl, info=[gl:core=4.6, gles2=3.2], extensions=29)
[12.09.2023 22:29:39][INFO ][glad ]: generating feature set FeatureSet(name=gl, info=[gl:core=4.6, gles2=3.2], extensions=29)
[12.09.2023 22:29:39][DEBUG ][glad.files ]: intercepted attempt to retrieve resource: 'https://raw.githubusercontent.com/KhronosGroup/EGL-Registry/main/api/KHR/khrplatform.h'
[12.09.2023 22:29:39][INFO ][glad.files ]: opening packaged resource: 'khrplatform.h'
[12.09.2023 22:29:39][INFO ][glad ]: generating egl:None/egl=None
[12.09.2023 22:29:39][INFO ][glad ]: no explicit version given for api egl, using Version(major=1, minor=5)
[12.09.2023 22:29:39][INFO ][glad ]: merging [FeatureSet(name=egl, info=[egl=1.5], extensions=7)]
[12.09.2023 22:29:39][INFO ][glad ]: merged into FeatureSet(name=egl, info=[egl=1.5], extensions=7)
[12.09.2023 22:29:39][INFO ][glad ]: generating feature set FeatureSet(name=egl, info=[egl=1.5], extensions=7)
[12.09.2023 22:29:39][DEBUG ][glad.files ]: intercepted attempt to retrieve resource: 'https://raw.githubusercontent.com/KhronosGroup/EGL-Registry/main/api/EGL/eglplatform.h'
[12.09.2023 22:29:39][INFO ][glad.files ]: opening packaged resource: 'eglplatform.h'
[25/81] Compiling C object demos/libnuklear.a.p/ui.c.o
ninja: build stopped: subcommand failed.
Changing ./libplacebo/demos/utils.c from this:
ifdef PL_HAVE_APPLE
include <sys/types.h>
include
endif
to this:
ifdef PL_HAVE_APPLE
include <sys/types.h>
include
include
endif
fixed the issue and let me compile. I hope this helps.
This is my first time posting on Github so apologies if don't know how things work. I tried to build but it kept erroring out saying the getuid() function in "struct passwd* pw = getpwuid(getuid());" is undefined. I went into ./libplacebo/demos/utils.c and added "#include" inside of "#ifdef PL_HAVE_APPLE" and it fixed the issue.
This is the error I got in terminal when the compile failed:
Changing ./libplacebo/demos/utils.c from this:
to this:
fixed the issue and let me compile. I hope this helps.