error C2146: syntax error : missing ';' before identifier '_sect'

Hello. I'm trying to run an MFC apps. GA Timetable. So I run into this two error.

c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\gascheduleview.h(19): error C2146: syntax error : missing ';' before identifier '_sect'
c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\gascheduleview.h(19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

The coding is as below

class Schedule;
enum AlgorithmState;

#pragma once
#include <afxwin.h>
#include <windows.h>
class CGaScheduleView : public CWnd



virtual ~CGaScheduleView();


CCriticalSection _sect;

Schedule* _schedule;

bool _running;


void SetSchedule(const Schedule* schedule);

void SetNewState(AlgorithmState state);


void ComputeScrollBars();

void Scroll(int scrollBar, int nSBCode, int nPos);


virtual BOOL PreCreateWindow(CREATESTRUCT& cs);


afx_msg void OnPaint();


afx_msg void OnFileStart();
afx_msg void OnFileStop();
afx_msg void OnFileOpenConfiguration();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
afx_msg void OnClose();
afx_msg void OnUpdateFileOpenConfiguration(CCmdUI *pCmdUI);
afx_msg void OnUpdateFileStart(CCmdUI *pCmdUI);
afx_msg void OnUpdateFileStop(CCmdUI *pCmdUI);

what happens if you #include<afxmt.h>?
its giving the errors backwards imo. it looks like it doesnt recognize CCriticalSection as a valid type
Registered users can post here. Sign in or register to post.