动态链接库定义为:class AFX_EXT_CLASS CExportCurve : public CObject
里面有个方法public double CalculateLogData()
主程序中调用动态链接库时出错,
Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall CExportCurve::GetCalibration(struct _CURVEITEM *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >,double *)" ([email protected]@@QAEHPAU_CURVEITEM@@[email protected][email protected][email protected]@ATL@@@@@ATL@@[email protected]) referenced in function "public: void __thiscall CDataDownloadDlg::GetCurveCilebParam(unsigned char *)" ([email protected]@@[email protected])
error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall CExportCurve::GetCalibration(struct _CURVEITEM *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >,double *)" ([email protected]@@QAEHPAU_CURVEITEM@@[email protected][email protected][email protected]@ATL@@@@@ATL@@[email protected])
在网上找了2天了,始终没有结果,希望各位高手能帮一下本小菜。谢谢
------解决方案--------------------
是否在动态链接库中,申明了导出了相应的函数呢?
在动态链接库中,申明 __declspec(dllexport) 导出
在引用项目中 申明 __declspec(dllimport) 导入
另外,导出库的 lib 文件,是否已引入呢?
------解决方案--------------------
两个都在vs2010里面编一下吧