C++ compiling error

October 14, 2009 at 04:47:37
Specs: Windows XP
I m getting error.....s as follws

/*--------------------------------------------------------------------------*/
// stchart.cpp - PegStripChart example
//
// Author: Jim DeLisle
//
// Copyright (c) 1997-2002 Swell Software, Inc.
// All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

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

extern 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 };


/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
StripChartWindow::StripChartWindow(const PegRect& Rect, const PEGUINT TitleId) :
PegDecoratedWindow(Rect)
{
PEGCOLOR tempColor1, tempColor2, tempColor3;
if(TitleId)
{
Add(new PegTitle(TitleId));
}

PegRect ChartRect = mClient;
ChartRect.Bottom = mClient.Height() / 2 - 2;
mpChart = new PegStripChart(ChartRect, 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(ChartRect, 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 StripChartWindow::Message(const PegMessage& Mesg)
{
static PEGINT Index = 0, j = 0;
static PEGINT Angle = 0;

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

case PM_HIDE:
PegWindow::Message(Mesg);
KillTimer(1);
break;

case PM_TIMER:
{
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)((Cos * 125) >> 10) + 400);
}

default:
{
return(PegWindow::Message(Mesg));
}
}

return 0;
}

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

PegResourceManager::InstallResourcesFromTable(&stchart_ResourceTable);
StripChartWindow* pWindow = new StripChartWindow(Rect, SID_TITLE);
pPresentation->Add(pWindow);


}


--------------------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: '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 C2086: 'PegStripChart' : redefinition
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) : 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)


See More: C++ compiling error

Report •


#1
October 14, 2009 at 15:19:26
This should be posted in the Programming Forum. The link is on the right side of this page.

Home Page http://ewen.uuuq.com/


Report •
Related Solutions


Ask Question