ld: library not found for -lgcrt1.o error
I have a macbook pro running mojave.
I trying to profile a program which works perfectly. When I compile
with -pg using clang as follows
clang test_program.c -o test_program_pg -pg
I get the following error
clang: error: the clang compiler does not support -pg option on
versions of OS X 10.9 and later
So i installed gcc with brew and tried to compile with -pg. This time I get
ld: library not found for -lgcrt1.o
collect2: error: ld returned 1 exit status
The gcc I used was /usr/local/Cellar/gcc/10.2.0/bin/gcc-10
How can this be fixed?
MacBook Pro 15″, macOS 10.13