I have a static member function defined in .h
file, which is working fine.
When I was trying to move the implementation to .cpp
file, the project build failed with LNK2019 error by another class that is calling this function.
Error message is:
8>------ Build started: Project: COrders, Configuration: Debug x64 ------
8> Creating library D:\devel\Server\COrders\Debugx64\COrders.lib and object D:\devel\Server\COrders\Debugx64\COrders.exp
8>OrderProcessor.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl COAValidator::ValidatePercentage(class CSDO const &,class CExecInstHelper const &,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const &)" (?ValidatePercentageXI@COAValidator@CPlus@@SA_NAEBVCSDO@AEBVCExecInstHelper@@AEBV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function "private: int __cdecl CPlus::COrderProcessor::DoCreate(int)" (?DoCreate@COrderProcessor@CPlus@@AEAAHH@Z)
8>D:\devel\Server\Server\COrders\Debugx64\COrdersd.dll : fatal error LNK1120: 1 unresolved externals
Here COrderProcessor::DoCreate()
is trying to call static bool COAValidator::ValidatePercentage()
, which provided via .dll
Any idea how to fix it?