title: undefined reference to OpenSSL_version, Error linking openssl?
body: <p>trying to run this simple program</p>
  <pre><code>#include &lt;openssl/ssl.h&gt;
  int main() {
      printf(&quot;version: %s\n&quot;, OpenSSL_version(0));
      return 0;
  }
  </code></pre>
  <p>result In this error</p>
  <pre><code>Scanning dependencies of target main
  [ 50%] Building C object CMakeFiles/main.dir/main.c.o
  [100%] Linking C executable main
  /usr/bin/ld: CMakeFiles/main.dir/main.c.o: in function `main':
  /home/khaled/CLionProjects/untitled2/main.c:4: undefined reference to `OpenSSL_version'
  collect2: error: ld returned 1 exit status
  make[3]: *** [CMakeFiles/main.dir/build.make:84: main] Error 1
  make[2]: *** [CMakeFiles/Makefile2:105: CMakeFiles/main.dir/all] Error 2
  make[1]: *** [CMakeFiles/Makefile2:112: CMakeFiles/main.dir/rule] Error 2
  make: *** [Makefile:131: main] Error 2
  </code></pre>
  <p>I am runinning ubuntu 20.04</p>
  <p>cmakelist.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.16)
  project(untitled2 C)
  
  set(CMAKE_C_STANDARD 99)
  add_executable(main main.c)
  </code></pre>
  <p>I guess there is no errors in linking since openssl is already in usr/include which is in turn in the preprocesser search tree. I am new with cmake so any expalnation would be really appreciated.</p>