MacOS: Building Main branch Error: linker command failed "_gzopen", referenced from: _BLI_gzopen

Hi there! Having some trouble building the Blender build. I’ve followed the instructions on this page:
https://developer.blender.org/docs/handbook/building_blender/mac/

but I’m getting an error at 65% when building the project:

[ 63%] Built target makesrna
Undefined symbols for architecture arm64:
"_gzopen", referenced from:
_BLI_gzopen in libbf_blenlib.a[49](fileops_c.cc.o)
ld: symbol(s) not found for architecture arm64
clang: **error:** **linker command failed with exit code 1 (use -v to see invocation)**
make[3]: *** [bin/msgfmt] Error 1
make[2]: *** [source/blender/blentranslation/msgfmt/CMakeFiles/msgfmt.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 65%] Built target extern_ceres
Consolidate compiler generated dependencies of target bf_rna
[ 66%] Built target bf_rna
make[1]: *** [all] Error 2
make: *** [all] Error 2

I have the full log but I can’t upload it as I’m new to the forum.

Thank you for taking the time to read this, appreciate your guidance to get past this error.

I ended up making a new user and trying to build Blender there. Worked first time. :sweat_smile:
Not sure what it is in my original user account it didn’t like.

Sometimes it helps removing the build folder (or just CMakeCache.txt). CMake likes to cache thing, and not properly update them afterwards.