我设立了一个DL(say CORE.DLL),我有以下班级/职务:
#ifdef RINZOCORE_SHARED
#define RINZO_LIB __declspec(dllexport)
#else
#define RINZO_LIB __declspec(dllimport)
#endif
我将许多在线职能定义为“出口”宏观,
class RINZO_LIB CVector
{
public:
CVector();//!< default constructor
..
real& x();//!< accessor for the x component (can be used as l-value too)
real& y();//!< accessor for the y component (can be used as l-value too)
real& z();//!< accessor for the z component (can be used as l-value too)
CVector& operator=(const CVector& other);//!< the assignment
CVector& operator+=(const CVector& other);//!< the sum & assign
CVector& operator-=(const CVector& other);//!< the subtract & assign
CVector& operator*=(const real& fact);//!< the short multiply by a scalar factor & assign
CVector& operator/=(const real& fact);//!< the short divide by a scalar factor & assign
..
}
RINZO_LIB inline CVector& CVector::operator=(const CVector& other)
{
//check for a=a case
if (this==&other) return *this;
vec[0]=other.vec[0];
vec[1]=other.vec[1];
vec[2]=other.vec[2];
return *this;
}
RINZO_LIB inline CVector& CVector::operator+=(const CVector& other)
{
vec[0]+=other.vec[0];
vec[1]+=other.vec[1];
vec[2]+=other.vec[2];
return *this;
}
RINZO_LIB inline CVector& CVector::operator-=(const CVector& other)
{
vec[0]-=other.vec[0];
vec[1]-=other.vec[1];
vec[2]-=other.vec[2];
return *this;
}
RINZO_LIB inline CVector& CVector::operator*=(const real& fact)
{
vec[0]*=fact;
vec[1]*=fact;
vec[2]*=fact;
return *this;
}
RINZO_LIB inline CVector& CVector::operator/=(const real& fact)
{
assert(fabs(fact) >= epsilon);
vec[0]/=fact;
vec[1]/=fact;
vec[2]/=fact;
return *this;
}
但是,当我使用DL(进口)汇编另一个DLL(say PluginA.DLL)时,它汇编了以下错误:
Info: resolving std::cout by linking to __imp___ZSt4cout (auto-import)
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&)
Info: resolving vtable for __cxxabiv1::__vmi_class_type_info by linking to __imp___ZTVN10__cxxabiv121__vmi_class_type_infoE (auto-import)
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&)
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&)
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&)
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&)
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&)
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&)
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&)
任何关于如何使用拖拉出口/进口的线性功能的问题?