title: Installation of libjpeg not found
body: <p>I'm new to macOS, and I'm having trouble using the library libjpeg.</p>
  <p>After installing with brew install jpeg, I even tried reinstalling.</p>
  <pre><code>joshbone@Joshs-Mac-mini ~ % brew reinstall jpeg
  ==&gt; 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
  ==&gt; Reinstalling jpeg 
  ==&gt; Pouring jpeg-9d.arm64_big_sur.bottle.tar.gz
    /opt/homebrew/Cellar/jpeg/9d: 21 files, 1001.2KB
  </code></pre>
  <p>Then I try to see if I can find the library, I type the following command in terminal: &quot;gcc -ljpeg&quot;. This gives output below:</p>
  <pre><code>ld: library not found for -ljpeg
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  <p>Why can't it find the library? And what can I do to fix the installation? Am I even using these terminal commands correctly?</p>
  <p>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:</p>
  <pre><code>Undefined symbols for architecture arm64:
    &quot;_main&quot;, 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)
  </code></pre>