title: Eclipse on Mac dyld: Library not loaded: Image not found
body: <p>All:</p>
  
  <p>I have successfully set up two projects (Hello and World) in one workspace (HelloWorld).  These are simple projects that are supposed to work together as a main project and a shared library project.  This is the structure:</p>
  
  <pre><code>HelloWorld
      Hello
          src
              Hello.cpp
          Debug
              src
              Hello - [x86_64/le]
      World
          src
              World.cpp
              World.h
          Debug
              src
              libWorld.dylib - (x86_64/le]
  </code></pre>
  
  <p>I have followed all instructions and finally was able to get them to compile with no errors.  However, when I try to run the Hello project I receive the following error:</p>
  
  <pre><code>dyld: Library not loaded: libWorld.dylib
    Referenced from: /Users/pdl/Development/HelloWorld/Hello/Debug/Hello
    Reason: image not found
  </code></pre>
  
  <p>I posted the code below.  It is super simple and the problem (I believe) is somewhere in the Eclipse configuration.</p>
  
  <p>Thank you in advance for your help.</p>
  
  <p>-------------------------------------------- <strong>Source Code</strong> ----------------------------------</p>
  
  <p><strong>Hello.cpp</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "World.h"
  
  int main() {
    printf("Hello %s\n", getWorld().c_str());
    return 0;
  }
  </code></pre>
  
  <p><strong>World.cpp</strong></p>
  
  <pre><code>#include "World.h"
  
  std::string getWorld() { return "World"; }
  </code></pre>
  
  <p><strong>World.h</strong></p>
  
  <pre><code>#include &lt;string&gt;
  
  std::string getWorld();
  </code></pre>