Solution with 2 projects does not compile

I have a solution with two projects. In the first project, I have Frame and some controls, in the second - CForcesEditorDialog: CDialog. I want to compare them. But this error does not allow me to compile the project:

MainFrame.obj: error LNK2019: unresolved external character "public: __thiscall CForcesEditorDialog :: CForcesEditorDialog (class CWnd *, class MainFrame *)" (?? 0CForcesEditorDialog @@ QAE @PAVCWnd @@ PAVMainFrame @@@ Z) link : 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;
}

Perhaps I had a problem with enabling these projects. I have never had a solution with two projects. Do you have any ideas about this?

+3
4

. Visual Studio CForcesEditorDialog , . .lib ( → Linker → Input → Additional Dependencies).

, .

+3

CForcesEditorDialog , ? , (cpp) CForcesEditorDialog , ? DLL?

+1

cut - CForcesEditorDialog MainFrame

0

CForcesEditorDialog? dll?

If it is dynamic, you will need to export the functions and classes from the DLL that you want to use in your exe. This guide mentions exports: http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c4017/MFC-DLL-TUTORIAL-PART-1.htm

From AFX_EXT_CLASS. You would use it in your class declaration to export it from your DLL, for example:

class AFX_EXT_CLASS CForcesEditorDialog : public CDialog
{
0
source

All Articles