我有 2 个项目的解决方案。在第一个项目中,我有 Frame 和一些控件,在第二个项目中 - CForcesEditorDialog:CDialog。Ofcouse我想比较它们。但是这个错误没有给我编译项目:
MainFrame.obj:错误 LNK2019:未解析的外部符号“public:__thiscall CForcesEditorDialog::CForcesEditorDialog(class CWnd *,class MainFrame *)”(??0CForcesEditorDialog@@QAE@PAVCWnd@@PAVMainFrame@@@Z) 在函数“protected”中引用: int __thiscall MainFrame::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@MainFrame@@IAEHPAUtagCREATESTRUCTA@@@Z)
class CForcesEditorDialog;
class MainFrame : public CFrameWnd
{
CForcesEditorDialog* forcesEditorDialog;
public:
MainFrame();
~MainFrame();
//virtual void CreateChildControls( void );
//afx_msg void OnMouseMove(UINT, CPoint);
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_MESSAGE_MAP()
};
int MainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
forcesEditorDialog = new CForcesEditorDialog(this,this);//CForcesEditorDialog(this,this);
}
class CForcesEditorDialog : public CDialog
{
//For including ForcesBar
ForcesBar* m_forcesBar;
MainFrame* pMainFrame;
public:
CForcesEditorDialog(CWnd* _pParentWnd = NULL, MainFrame* _pMainFrame = NULL); // standard constructor
}
CForcesEditorDialog::CForcesEditorDialog(CWnd* _pParentWnd, MainFrame* _pMainFrame)
: CDialog(IDD_CUR_DIALOG, _pParentWnd),
p_expander (0),
p_selectedItem(0),
m_enabled (false)
{
m_forcesBar = new ForcesBar();
pMainFrame = _pMainFrame;
}
可能是我在包含这个项目时遇到了问题。我从来没有用过 2 个项目的解决方案。你有什么想法吗?