title: Import error "undefined symbol: _ZNK9FastNoise8GetNoiseEff" when calling C++ extension in Python 3.6
body: <p>I am currently trying to make some C++ extensions for a python script. In the C++ side of the story, it seems to be compiled just fine and it generates my <code>.so</code> shared library, but when I call it inside my python script it raises an error of undefined symbol. The current code is as follow:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "FastNoise.h"
  #include &lt;string&gt;
  #include &lt;time.h&gt;
  
  #include &lt;opencv2/core.hpp&gt;
  #include &lt;opencv2/imgcodecs.hpp&gt;
  #include &lt;opencv2/highgui.hpp&gt;
  
  #include &lt;boost/python/def.hpp&gt;
  #include &lt;boost/python/module.hpp&gt;
  
  using namespace std;
  using namespace cv;
  namespace bp = boost::python;
  
  int gen(int _size)
  {
      FastNoise myNoise;
      myNoise.SetNoiseType(FastNoise::Simplex);
      myNoise.SetSeed((int)(rand() * time(NULL)));
  
      Size img_size(_size, _size);
      Mat noise_map(img_size, CV_32FC3);
  
      for (int y = 0; y &lt; _size; y++) {
          for (int x = 0; x &lt; _size; x++) {
              Vec3f &amp;color = noise_map.at&lt;Vec3f&gt;(Point(x, y));
              color.val[0] = (myNoise.GetNoise(x, y) + 1) / 2;
              color.val[1] = (myNoise.GetNoise(x, y) + 1) / 2;
              color.val[2] = (myNoise.GetNoise(x, y) + 1) / 2;
          }
      }
  
      imshow("test", noise_map);
      waitKey(0);
      return 0;
  }
  
  BOOST_PYTHON_MODULE(gen) {
      bp::def("gen", gen);
  }
  </code></pre>
  
  <p>And here is how I compiled it:</p>
  
  <pre><code>g++ main.cpp -I/opt/opencv/include/opencv -I/usr/include/python3.6m -I/usr/local/include/boost -L/opt/opencv/release/lib -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -L/usr/local/lib -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lpython3.6m -lboost_python36 -o NoiseModule.so -shared -fPI
  </code></pre>
  
  <p>When I import it within python it gives me this error:</p>
  
  <pre><code>&gt;&gt;&gt; import NoiseModule
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: /home/matheus/PycharmProjects/TerrainGenerator/NoiseGenerator/NoiseModule.so: undefined symbol: _ZNK9FastNoise8GetNoiseEff
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>Any kind of help in regards of this problem will be really appreciated.</p>