@Yash001 said in why definition is talking from .cpp file?:
why it is working if I will define the definition inside the class
Because then the compiler sees the definition when you compile your executable.
just now I try Q_DECL_EXPORT virtual QString GetExpParamTxt(QWidget*)const;. I got same error.
You did not read the link carefully... you have to export it when compiling the lib, import it when linking against as explained.