Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 3.80 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. C   : inline functions with dllimport/dllexport?
  2. #ifdef RINZOCORE_SHARED
  3. #define RINZO_LIB __declspec(dllexport)
  4. #else
  5. #define RINZO_LIB __declspec(dllimport)
  6. #endif
  7.        
  8. class RINZO_LIB CVector
  9. {
  10.  
  11. public:
  12.     CVector();//!< default constructor
  13.     ..
  14.     real& x();//!< accessor for the x component (can be used as l-value too)
  15.     real& y();//!< accessor for the y component (can be used as l-value too)
  16.     real& z();//!< accessor for the z component (can be used as l-value too)
  17.     CVector& operator=(const CVector& other);//!< the assignment
  18.     CVector& operator+=(const CVector& other);//!< the sum & assign
  19.     CVector& operator-=(const CVector& other);//!< the subtract & assign
  20.     CVector& operator*=(const real& fact);//!< the short multiply by a scalar factor & assign
  21.     CVector& operator/=(const real& fact);//!< the short divide by a scalar factor & assign
  22. ..
  23. }
  24.  
  25. RINZO_LIB inline CVector& CVector::operator=(const CVector& other)
  26. {
  27.     //check for 'a=a' case
  28.     if (this==&other) return *this;
  29.     vec[0]=other.vec[0];
  30.     vec[1]=other.vec[1];
  31.     vec[2]=other.vec[2];
  32.     return *this;
  33. }
  34.  
  35. RINZO_LIB inline CVector& CVector::operator+=(const CVector& other)
  36. {
  37.     vec[0]+=other.vec[0];
  38.     vec[1]+=other.vec[1];
  39.     vec[2]+=other.vec[2];
  40.     return *this;
  41. }
  42.  
  43. RINZO_LIB inline CVector& CVector::operator-=(const CVector& other)
  44. {
  45.     vec[0]-=other.vec[0];
  46.     vec[1]-=other.vec[1];
  47.     vec[2]-=other.vec[2];
  48.     return *this;
  49. }
  50.  
  51. RINZO_LIB inline CVector& CVector::operator*=(const real& fact)
  52. {
  53.     vec[0]*=fact;
  54.     vec[1]*=fact;
  55.     vec[2]*=fact;
  56.     return *this;
  57. }
  58.  
  59. RINZO_LIB inline CVector& CVector::operator/=(const real& fact)
  60. {
  61.     assert(fabs(fact) >= epsilon);
  62.     vec[0]/=fact;
  63.     vec[1]/=fact;
  64.     vec[2]/=fact;
  65.     return *this;
  66. }
  67.        
  68. Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-import)
  69. CMakeFilesContourViewer.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&, quaternion const&)'
  70. Info: resolving vtable for __cxxabiv1::__vmi_class_type_info by linking to __imp___ZTVN10__cxxabiv121__vmi_class_type_infoE (auto-import)
  71. CMakeFilesContourViewer.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&, quaternion const&)'
  72. CMakeFilesContourViewer.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&, CVector const&)'
  73. CMakeFilesContourViewer.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&, CVector const&)'
  74. CMakeFilesContourViewer.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&, CVector const&)'
  75. CMakeFilesContourViewer.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&, CVector const&)'
  76. CMakeFilesContourViewer.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&, float const&)'
  77. CMakeFilesContourViewer.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&, CVector const&)'