"Recompile with -fPIC" error persists even after adding -fPIC compile flag
<p>I have downloaded some C++ which I want to compile from source. After running <code>cmake ../src</code> and then <code>make</code> from the command line, whilst in the build directory, I get the following error:</p>

<pre><code>/usr/bin/ld: /usr/local/lib/libBulletCollision.a(btDbvtBroadphase.o):
relocation R_X86_64_32S against `_ZTV16btDbvtBroadphase' can not be used when making a shared object;
recompile with -fPIC
</code></pre>

<p>I believe that this is something to do with trying to create a shared library, but not providing the necessary memory to do so (although I don't fully understand this...). Anyway, following the advice I've seen around, I tried the following instead:</p>

<pre><code>make CXXFLAGS='-fPIC'
</code></pre>

<p>However, this gives me exactly the same error as before. Any ideas as to why this did not solve the problem?</p>