2009-10-15 3 views
-3

이 두 파일을 컴파일 할 때 많은 오류가 발생합니다. 제발 도와주세요.Visual C++ 컴파일 오류

stchart.cpp

# include "peg.hpp" 
# include "stchart.hpp" 
# include "stchart_res.hpp" 

external PegResourceTable stchart_ResourceTable; 

PEGINT gChartData [] = (100, 100, 100, 100, 100, 100, 125, 150, 175, 200, 
         150, 100, 50, 100, 125, 100, 100, 100); 

PEGINT gBukData [] = (100, 100, 100, 100, 100, 100, 100, 100, 125, 100, 
         100, 120, 140, 160, 180, 200, 150, 100, 50, 125, 100, 
         100, 125, 150, 125, 100, 100, 100, 100); 


/*------------------------------------------------ --------------------------*/ 
/*------------------------------------------------ --------------------------*/ 
Strip Chart Window:: Window Strip Chart (PegRect const Rect &, 
              const PEGUINT titleid): 
           PegDecoratedWindow (Rect) 
( 
    PEGCOLOR tempColor1, tempColor2, tempColor3; 
    if (titleid) 
    ( 
     Add (new PegTitle (titleid)); 
    ) 

    PegRect Chart mClient = Rect; 
    ChartRect.Bottom = mClient.Height()/2 to 2; 
    mpChart = new PegStripChart (Chart Rect, 130, -100, 700, 10, 100); 
    mpChart-> SetExStyle (mpChart-> GetExStyle() | CS_DRAWYGRID | 
         CS_DRAWXGRID | CS_DRAWXTICS | CS_DRAWYLABELS | 
         CS_SCROLLED |// CS_DUALYTICS | CS_DRAWLINEFILL | 
         CS_DRAWXLABELS | CS_DUALYTICS | CS_DRAWXLABELS | 
         CS_DUALYLABELS); 
    mpChart-> SetExStyle (mpChart-> GetExStyle() & ~ CS_PAGED); 
    Add (mpChart); 
    tempColor1 = PegResourceManager:: GetColor (CID_CYAN); 
    tempColor2 = PegResourceManager:: GetColor (CID_BLUE); 
    tempColor3 = PegResourceManager:: GetColor (CID_MAGENTA); 
    mSin = mpChart-> AddLine (tempColor1, tempColor1, tempColor3); 

    tempColor1 = PegResourceManager:: GetColor (CID_LIGHTGREEN); 
    tempColor2 = PegResourceManager:: GetColor (CID_GREEN); 
    tempColor3 = PegResourceManager:: GetColor (CID_RED); 
    MID-mpChart => AddLine (tempColor1, tempColor1, tempColor3); 
    mpChart-> SetYLabelScale (200); 

    ChartRect.Top = ChartRect.Bottom + 4; 
    ChartRect.Bottom = mClient.Bottom; 
    mpChart2 = new PegStripChart (Chart Rect, 130, -200, 600, 10, 100); 
    mpChart2-> SetExStyle (mpChart2-> GetExStyle() | CS_DRAWAGED | 
         CS_XAXISONZEROY | CS_DRAWXTICS | CS_DRAWXLABELS); 
         // CS_DRAWLINEFILL); 

    Add (mpChart2); 
    tempColor1 = PegResourceManager:: GetColor (CID_LIGHTBLUE); 
    tempColor2 = PegResourceManager:: GetColor (CID_BLUE); 
    tempColor3 = PegResourceManager:: GetColor (CID_CYAN); 
    mSin2 = mpChart2-> AddLine (tempColor1, tempColor1, tempColor3); 

    tempColor1 = PegResourceManager:: GetColor (CID_LIGHTGREEN); 
    tempColor2 = PegResourceManager:: GetColor (CID_GREEN); 
    tempColor3 = PegResourceManager:: GetColor (CID_GREEN); 
    mID2 = mpChart2-> AddLine (tempColor1, tempColor1, tempColor3); 

) 

/*------------------------------------------------ --------------------------*/ 
/*------------------------------------------------ --------------------------*/ 
PEGINT Strip Chart Window:: Message (const PegMessage & mesg) 
( 
    static PEGINT Index = 0, j = 0; 
    static PEGINT Angle = 0; 

    switch (Mesg.Type) 
    ( 
    PM_SHOW case: 
     PegWindow:: Message (mesg); 
     SetTimer (1, PEG_ONE_SECOND, 1); 
     break; 

    PM_HIDE case: 
     PegWindow:: Message (mesg); 
     Kill Timer (1); 
     break; 

    PM_TIMER case: 
     ( 
      if (+ + index> 17) 
      ( 
       Index = 0; 
      ) 

      mpChart-> AddData (MID, gChartData [Index]); 

      if (+ + j> 28) 
      ( 
       j = 0; 
      ) 
      mpChart2-> AddData (mID2, gBukData [j]); 

      if ((Angle + = 10)> 350) 
      ( 
       Angle = 0; 
      ) 

      PEGINT Sin, Cos; 
      PegLookupSinCos (Angle, & Sin, Cos &); 
      mpChart-> AddData (mSin, (PEGLONG) ((Sin * 125)>> 10) + 400); 
      mpChart2-> AddData (mSin2, (PEGLONG) ((125 * Cos)>> 10) + 400); 
     ) 

    default: 
     ( 
      return (PegWindow:: Message (mesg)); 
     ) 
    ) 

    return 0; 
) 

/*------------------------------------------------ --------------------------*/ 
/*------------------------------------------------ --------------------------*/ 
void PegAppInitialize (PegPresentationManager * pPresentation) 
( 
    PegRect Rect; 
    Rect.Set (10, 10, 630, 470); 

    PegResourceManager:: Install Resources From Table (& 
                stchart_ResourceTable); 
    Strip Chart Window * pWindow = new Strip Chart Window (Rect, SID_TITLE); 
    pPresentation-> Add (pWindow); 


) 

stchart.hpp :

Strip Chart class Window: public PegDecoratedWindow 
( 
    public: 
     Strip Chart Window (PegRect const Rect &, const PEGUINT titleid); 
     Strip Chart virtual ~ Window()() 

     virtual PEGINT Message (const PegMessage & mesg); 

    public: 
PegStripChart * mpChart; 
PegStripChart * mpChart2; 

     PEGUBYTE mid; 
     PEGUBYTE mSin; 
     PEGUBYTE mID2; 
     PEGUBYTE mSin2; 
); 

오류 : 그것은 나타납니다

 
    -------------------- Configuration: stchart - Win32 Debug -------------------- 
    Compiling ... 
    stchart.cpp 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.hpp (29): error C2143: syntax error: missing ',' before '*' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.hpp (29): error C2501: 'PegStripChart': missing storage-class or type specifiers 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.hpp (29): error C2501: 'mpChart': missing storage-class or type specifiers 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.hpp (30): error C2143: syntax error: missing ',' before '*' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.hpp (30): error C2501: 'PegStripChart': missing storage-class or type specifiers 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.hpp (30): error C2501: 'mpChart2': missing storage-class or type specifiers 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (45): error C2065: 'mpChart': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (45): error C2061: syntax error: identifier 'PegStripChart' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (46): error C2227: left of '-> SetExStyle' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (46): error C2227: left of '-> GetExStyle' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (46): error C2065: 'CS_DRAWYGRID': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (46): error C2065: 'CS_DRAWXGRID': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (47): error C2065: 'CS_DRAWXTICS': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (47): error C2065: 'CS_DRAWYLABELS': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (47): error C2065: 'CS_SCROLLED': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (49): error C2065: 'CS_DUALYTICS': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (49): error C2065: 'CS_DRAWXLABELS': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (50): error C2065: 'CS_DUALYLABELS': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (51): error C2227: left of '-> SetExStyle' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (51): error C2227: left of '-> GetExStyle' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (51): error C2065: 'CS_PAGED': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (56): error C2227: left of '-> AddLine' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (61): error C2227: left of '-> AddLine' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (62): error C2227: left of '-> SetYLabelScale' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (66): error C2065: 'mpChart2': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (66): error C2061: syntax error: identifier 'PegStripChart' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (67): error C2227: left of '-> SetExStyle' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (67): error C2227: left of '-> GetExStyle' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (67): error C2065: 'CS_DRAWAGED': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (68): error C2065: 'CS_XAXISONZEROY': undeclared identifier 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (75): error C2227: left of '-> AddLine' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (80): error C2227: left of '-> AddLine' must point to class/struct/union 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): error C2143: syntax error: missing ',' before ')' 
    c: \ swellsoftware \ pegplus \ examples \ stchart \ plus \ stchart.cpp (82): fatal error C1003: error count exceeds 100; stopping compilation 
    Error executing cl.exe. 

    ** stchart.obj - 102 error (s), 0 warning (s) ** 
+1

게시물을 다시 포맷 해보십시오. 읽을 수 없습니다. –

+0

포맷을 바꾸어서 (오른쪽 전체를 들여 쓰기) 조심하고 적어도 "line 29", "line 82"등의 위치를 ​​지정하십시오. –

+0

무엇이'ChartRect.Bottom = mClient.Height()/2 to 2; (~ 2?) – Naveen

답변

1

PE gStripChart는 여러분이 우리에게 보여 주신 파일 중 어떤 것에도 선언되지 않았으며 최소한 이것은 처음 몇가지 오류를 일으키는 것으로 보입니다.

peg.hpp에 선언되어 있습니까? 스위치 운영자에

1

에주의 그것은해야한다 :

switch (Mesg.Type) 
( 
    case PM_SHOW: 
    PegWindow:: Message (mesg); 
    SetTimer (1, PEG_ONE_SECOND, 1); 
    break; 

    case PM_HIDE: 
    PegWindow:: Message (mesg); 
    Kill Timer (1); 
    break; 
............................. 
............................. 

And you wrote: 

switch (Mesg.Type) 
( 
    PM_SHOW case : 
    PegWindow:: Message (mesg); 
    SetTimer (1, PEG_ONE_SECOND, 1); 
    break; 

    PM_HIDE case : 
    PegWindow:: Message (mesg); 
    Kill Timer (1); 
    break; 

........................ .... .................

0

당신이 사용하는()의 사용 할 위치 {}의

예를 들어, 귀하의 경우 블록이, 스위치 문 , 메소드 선언 등.