Expected ')' before the token '*'

So this is more of a syntax issue. I keep getting the error "Expected") until "*" in the line:

#include "CDocumentObserver.h" #include "CViewPlayerDlg.h" /* * Class: CViewPlayer * */ class CViewPlayer : public wxWindow, public CDocumentObserver { public: CViewPlayer(CViewPlayerDlg *dlg); //here 

in CViewPlayer.h. The .cpp constructor looks like this:

 #include "CViewPlayer.h" #include "wx/prec.h" #include "CViewPlayerDlg.h" using namespace std; BEGIN_EVENT_TABLE(CViewPlayer, wxWindow) EVT_PAINT(CViewPlayer::OnPaint) END_EVENT_TABLE() CViewPlayer::CViewPlayer(CViewPlayerDlg *dlg) : wxWindow(dlg, wxID_ANY, wxDefaultPosition, wxSize(dlg->GetDocument()->GetSize()), wxBORDER_SUNKEN), CDocumentObserver(dlg->GetDocument()), mStartTime(0), mPlayTime(0), mPlaying(false) { SetBackgroundColour(wxColour(128, 128, 128)); SetClientSize(GetDocument()->GetSize()); } 

What causes this error? I thought something was wrong in the .cpp constructor, but I have no idea.

+4
source share
1 answer

This usually means that the class has not been declared.

Verify that CViewPlayerDlg declared before you use it in the declaration of the CViewPlayer constructor, CViewPlayer(CViewPlayerDlg* dlg) .

A syntax error in the header file usually means that the error is in the header file and not in the source (.cpp).

+5
source

Source: https://habr.com/ru/post/1305060/


All Articles