Compile error on mac: ld: file too small

when I compile blender on mac, got

ld: file too small (length=15) file '/Users/dashuai/blender-git/lib/darwin/png/lib/libpng.a' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [bin/datatoc_icon] Error 1
make[2]: *** [source/blender/datatoc/CMakeFiles/datatoc_icon.dir/all] Error 2

my env:

  • macos 13.4
  • xcode 14.0
  • blender branch: blender-v3.5-release

How can i fix this? thanks.

I haven’t seen this error before, not sure what could have caused it. Possibly the svn checkout timed out or ran into some error part way through.

I suggest to try something like this to restore or complete it:

cd /Users/dashuai/blender-git/lib/darwin/
svn cleanup
svn revert -R .
svn up
1 Like

thanks a lot. This has solved my problem. :kissing_heart:
lib/darwin/png/lib/libpng.a is just a quick link of lib/darwin/png/lib/libpng16.a . The lib/ folder was copied from a windows pc. :upside_down_face: