2021年3月8日星期一

Unresolved external symbol in C++ in VS2015

while coding in c++ 2015, I got a following error:

AEAssetGapMetricCalculator.obj : error LNK2019: unresolved external symbol "public: static double __cdecl CombinableSensitivityFormatter::getResultFromState(class CombinableSensitivityFormatterState const &)" (?getResultFromState@CombinableSensitivityFormatter@@SANABVCombinableSensitivityFormatterState@@@Z) referenced in function "protected: virtual void __thiscall AEAssetGapMetricTableFormatter::constructMetricRows(class MetricSession const *,class CombinableSensitivityFormatterState const &,class SparseRiskMapper::RiskIterator &,unsigned int,class SmartPtr const &)" (?constructMetricRows@AEAssetGapMetricTableFormatter@@MAEXPBVMetricSession@@ABVCombinableSensitivityFormatterState@@AAVRiskIterator@SparseRiskMapper@@IABV?$SmartPtr@VAETableRow@@@@@Z)

the function is declared in MetricTable.h headerfile

static double getResultFromState(const CombinableSensitivityFormatterState& state)  

and defined in MetricTable.cpp

double CombinableSensitivityFormatter::getResultFromState(const CombinableSensitivityFormatterState& state)  {      int iBatch = state.iterator->getResultIndex();      if (iBatch == -1)          iBatch = 0;        const double* pResult = state.resultsBegin + iBatch;      ASSERT(pResult < state.resultsEnd);      return *pResult;  }  

does anyone know the reason of this error?

https://stackoverflow.com/questions/66539429/unresolved-external-symbol-in-c-in-vs2015 March 09, 2021 at 09:15AM

没有评论:

发表评论