title: embedding Julia in C/C++ on OSX
body: <p>I am trying to compile a very simple C/C++ program to call Julia functions. Following the instructions that you find on the Julia documentation page, I set up my link path to <code>/Users/william.calhoun/Desktop/romeo/lib/julia</code> looking for <code>libjulia.so</code> and I set up my include path to <code>/Users/william.calhoun/Desktop/romeo/include/julia</code> looking for <code>julia.h</code></p>
  
  <p>I have a C file called test.c which runs the following code:</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include "skeleton.h"
  #include &lt;julia.h&gt;
  
  
  int main(int argc, const char * argv[]) {
  
      jl_init(NULL);
  
      /* run julia commands */
      jl_eval_string("print(sqrt(2.0))");
  
      /* strongly recommended: notify julia that the
       program is about to terminate. this allows
       julia time to cleanup pending write requests
       and run all finalizers
       */
  
  
      jl_atexit_hook();
  
     return 0;
  }
  </code></pre>
  
  <p>However this yields the following error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
      "_jl_atexit_hook", referenced from:
          _main in test.o
      "_jl_eval_string", referenced from:
          _main in test.o
      "_jl_init", referenced from:
          _main in test.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I am not doing anything other than calling functions defined properly (hopefully) within the Julia source code. What am I doing wrong? This seems like the simplest example and I can't figure it out.</p>
  
  <p>Any help would be much appreciated!</p>