title: swig error: Undefined Symbol
body: <p>I'm having trouble with swig and to me it looks like it is saying that one of the data members of my code is an undefined symbol. I have found answers online on how to fix functions but this is puzzling me.</p>
  
  <p>My error is:</p>
  
  <pre><code>Traceback (most recent call last):
    File "./test1.py", line 5, in &lt;module&gt;
      from volumes import *
    File "/scratch/rjkern/projects/RJKERN_volrend/scripts/volumes.py", line 26, in &lt;module&gt;
      _volumes = swig_import_helper()
    File "/scratch/rjkern/projects/RJKERN_volrend/scripts/volumes.py", line 22, in swig_import_helper
      _mod = imp.load_module('_volumes', fp, pathname, description)
  ImportError: /scratch/rjkern/projects/RJKERN_volrend/scripts/_volumes.so: undefined symbol: _ZN13ConstantColorC1ESt10shared_ptrI5ColorE
  </code></pre>
  
  <p>And this is my code:</p>
  
  <pre><code>/*
   *  ColorOperations.h
   */
  
  #ifndef ___COLOROPS___
  #define ___COLOROPS___
  
  #include "Color.h"
  #include "ProgressMeter.h"
  #include "Vector.h"
  #include "Volume.h"
  #include "VolumeOperations.h"
  
  #include &lt;memory&gt;
  
  using namespace std;
  
  class ConstantColor : public Volume&lt;Color&gt;{
      shared_ptr &lt;Color&gt; color;
  
  public:
      ConstantColor(const shared_ptr&lt;Color&gt;&amp; _color);
  
      const Color eval(const Vector&amp; P) const;
      Color grad(const Vector&amp; P);
  };
  #endif
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>/*
   *  ColorOperations.cpp
   */
  
  #include "ColorOperations.h"
  
  ConstantColor::ConstantColor(const shared_ptr&lt;Color&gt;&amp; _color){
      color = _color;
  }
  
  const Color ConstantColor::eval(const Vector&amp; P)const{
      return *color;
  }
  </code></pre>