信创环境 / 经验分享 · 2025年2月8日

ld: library not found for -lcrt0.o in OSX

This option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static. Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people.

SO, just delete the -static parameter in CMakeList.txt or gcc parameters.