How to fix undefined reference to `b2World::b2World(b2Vec2 const&)'
<p>main.cpp</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;Box2D/Box2D.h&gt;

int main() {
    int32 velocityIterations = 6;
    int32 positionIterations = 2;
    b2Vec2 gravity(0.0f, -10.0f);
    b2World world(gravity);

    std::cout &lt;&lt; "Hello, world!" &lt;&lt; std::endl;
}
</code></pre>

<p>The error I get:</p>

<blockquote>
  <p>undefined reference to `b2World::b2World(b2Vec2 const&amp;)'</p>
</blockquote>

<p>When I try linking Box2D in CMakeLists.txt:</p>

<pre><code>include_directories(C:/Users/blahblah/CPPLibs)
target_link_libraries(HelloWorld Box2D)
</code></pre>

<p>I get:</p>

<blockquote>
  <p>c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lBox2D</p>
</blockquote>

<p>How I can properly import Box2D to my project?</p>