I'm new to macOS, and I'm having trouble using the library libjpeg.
After installing with brew install jpeg, I even tried reinstalling.
joshbone@Joshs-Mac-mini ~ % brew reinstall jpeg
==> Downloading https://homebrew.bintray.com/bottles/jpeg-9d.arm64_big_sur.bottl
Already downloaded: /Users/joshbone/Library/Caches/Homebrew/downloads/12e480d7337641afc99230ff2b626197e3206ea378eef8ccbb8b11f587afe7f4--jpeg-9d.arm64_big_sur.bottle.tar.gz
==> Reinstalling jpeg
==> Pouring jpeg-9d.arm64_big_sur.bottle.tar.gz
/opt/homebrew/Cellar/jpeg/9d: 21 files, 1001.2KB
Then I try to see if I can find the library, I type the following command in terminal: "gcc -ljpeg". This gives output below:
ld: library not found for -ljpeg
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Why can't it find the library? And what can I do to fix the installation? Am I even using these terminal commands correctly?
EDIT: I managed to find the symlink (.dylib) under /opt/homebrew/Cellar/jpeg/9d/lib. But when I ran gcc -ljpeg -L /opt/homebrew/Cellar/jpeg/9d/lib/, I get the following error message:
Undefined symbols for architecture arm64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)