user28256843
user28256843

Reputation: 1

how to fix clang: error: -lm: 'linker' input unused [-Werror,-Wunused-command-line-argument]?

I downloaded homebrew, gcc14 and pasted the path on compiler.

Then it worked when I pasted the flags:

 -DCMAKE_C_FLAGS="-Wall -Werror -pedantic-errors -lm -g"

But it didn’t build and showed:

FAILED: CMakeFiles/HW0.dir/main.c.o
/usr/bin/gcc   -Wall -Werror -lm -pedantic-errors -g -g -std=gnu99 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk -fcolor-diagnostics -MD -MT CMakeFiles/HW0.dir/main.c.o -MF CMakeFiles/HW0.dir/main.c.o.d -o CMakeFiles/HW0.dir/main.c.o -c /Users/noharbatit/CLionProjects/HW0/main.c
clang: error: -lm: 'linker' input unused \[-Werror,-Wunused-command-line-argument\]
ninja: build stopped: subcommand failed.

I have MacBook intel chip with macOS 15 sequoia help please

I tried to redownload clion homebrew reinstall Xcode paste path directly.

but it seems nothing is working

Upvotes: 0

Views: 21

Answers (0)

Related Questions