0
votes

VC2012, I have a solution with many projects.
I have made a "Common" project that contains classes to be used from another projects (for general purpose).
Under "Common" I added a class named

"PreRequisitesManager" (cpp+h)

and interface

(PreRequisitesInterface).

On "Client" project (Added as dependency the "Common" project) I have class

ClientDlg

. the interface was added as needed and added a member of type

'PreRequisitesManager'

.

The ClientDlg.h includes "PreRequisitesManager.h"
PreRequisitesManager includes the PreRequisitesInterface.h.

I am getting this:

GetCVClientDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CPreRequisitesManager::~CPreRequisitesManager(void)" (??1CPreRequisitesManager@@QAE@XZ) referenced in function __unwindfunclet$??0CGetCVClientDlg@@QAE@PAVCWnd@@@Z$0 GetCVClientDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CPreRequisitesManager::CPreRequisitesManager(void)" (??0CPreRequisitesManager@@QAE@XZ) referenced in function "public: __thiscall CGetCVClientDlg::CGetCVClientDlg(class CWnd *)" (??0CGetCVClientDlg@@QAE@PAVCWnd@@@Z) .

1
The linker is complaining there is no definition for the destructor and the default constructor of CPreRequisitesManager. Are these functions defined in "Common"? Does "Client" link "Common"? And if "Common" is a DLL, are they exported?Angew is no longer proud of SO
Seems most likely that you forgot to export CPreRequisitesManager. Eg, __declspec(dllexport). You'll need some preprocessor defines to determine whether to dllexport or dllimport. That's been covered on here before if you google it.Bret Kuhns
Common is not a DLL. These functions are ONLY in PreRequisitesManager, What do you mean Client link Common ? And there are no class named Common, inside the project Common i only have "CommonDefs.h" for global defintionsilansch
I have made: class __declspec(dllexport) CPreRequisitesManagerilansch

1 Answers

0
votes

Fixed.

the problem was the project was compiled as EXE and not as DLL.

Thanks for help.