title: C++ : inline functions with dllimport/dllexport?
body: <p>I create a DLL (say CORE.DLL)  ,I have classes/functions declared as follows:</p>
  
  <pre><code>#ifdef RINZOCORE_SHARED
  #define RINZO_LIB __declspec(dllexport)
  #else
  #define RINZO_LIB __declspec(dllimport)
  #endif
  </code></pre>
  
  <p>I have defined many inline functions with "dllexport" macro ,</p>
  
  <pre><code>class RINZO_LIB CVector
  {
  
  public:
      CVector();//!&lt; default constructor
      ..
      real&amp; x();//!&lt; accessor for the x component (can be used as l-value too)
      real&amp; y();//!&lt; accessor for the y component (can be used as l-value too)
      real&amp; z();//!&lt; accessor for the z component (can be used as l-value too)
      CVector&amp; operator=(const CVector&amp; other);//!&lt; the assignment
      CVector&amp; operator+=(const CVector&amp; other);//!&lt; the sum &amp; assign
      CVector&amp; operator-=(const CVector&amp; other);//!&lt; the subtract &amp; assign
      CVector&amp; operator*=(const real&amp; fact);//!&lt; the short multiply by a scalar factor &amp; assign
      CVector&amp; operator/=(const real&amp; fact);//!&lt; the short divide by a scalar factor &amp; assign
  ..
  }
  
  RINZO_LIB inline CVector&amp; CVector::operator=(const CVector&amp; other)
  {
      //check for 'a=a' case
      if (this==&amp;other) return *this;
      vec[0]=other.vec[0];
      vec[1]=other.vec[1];
      vec[2]=other.vec[2];
      return *this;
  }
  
  RINZO_LIB inline CVector&amp; CVector::operator+=(const CVector&amp; other)
  {
      vec[0]+=other.vec[0];
      vec[1]+=other.vec[1];
      vec[2]+=other.vec[2];
      return *this;
  }
  
  RINZO_LIB inline CVector&amp; CVector::operator-=(const CVector&amp; other)
  {
      vec[0]-=other.vec[0];
      vec[1]-=other.vec[1];
      vec[2]-=other.vec[2];
      return *this;
  }
  
  RINZO_LIB inline CVector&amp; CVector::operator*=(const real&amp; fact)
  {
      vec[0]*=fact;
      vec[1]*=fact;
      vec[2]*=fact;
      return *this;
  }
  
  RINZO_LIB inline CVector&amp; CVector::operator/=(const real&amp; fact)
  {
      assert(fabs(fact) &gt;= epsilon);
      vec[0]/=fact;
      vec[1]/=fact;
      vec[2]/=fact;
      return *this;
  }
  </code></pre>
  
  <p>but when I use this DLL (import) compile another DLL (say PluginA.DLL) it gives following compile errors :</p>
  
  <pre><code>Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-import)
  CMakeFiles\ContourViewer.dir/objects.a(RzStateDoAnimation.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/statemachine/RzStateDoAnimation.cpp:79: undefined reference to `operator!=(quaternion const&amp;, quaternion const&amp;)'
  Info: resolving vtable for __cxxabiv1::__vmi_class_type_info by linking to __imp___ZTVN10__cxxabiv121__vmi_class_type_infoE (auto-import)
  CMakeFiles\ContourViewer.dir/objects.a(RzStateDoAnimation.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/statemachine/RzStateDoAnimation.cpp:146: undefined reference to `operator==(quaternion const&amp;, quaternion const&amp;)'
  CMakeFiles\ContourViewer.dir/objects.a(BallController.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/trackball/BallController.cpp:159: undefined reference to `operator*(CVector const&amp;, CVector const&amp;)'
  CMakeFiles\ContourViewer.dir/objects.a(BallController.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/trackball/BallController.cpp:165: undefined reference to `operator^(CVector const&amp;, CVector const&amp;)'
  CMakeFiles\ContourViewer.dir/objects.a(BallController.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/trackball/BallController.cpp:168: undefined reference to `operator-(CVector const&amp;, CVector const&amp;)'
  CMakeFiles\ContourViewer.dir/objects.a(BallController.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/trackball/BallController.cpp:292: undefined reference to `operator*(CVector const&amp;, CVector const&amp;)'
  CMakeFiles\ContourViewer.dir/objects.a(BallController.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/trackball/BallController.cpp:292: undefined reference to `operator*(CVector const&amp;, float const&amp;)'
  CMakeFiles\ContourViewer.dir/objects.a(BallController.cpp.obj):C:/svn/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/contourviewer/trackball/BallController.cpp:292: undefined reference to `operator-(CVector const&amp;, CVector const&amp;)'
  </code></pre>
  
  <p>Any tips on how to use inline functions with dllexport/dllimport ?</p>