Click to See Complete Forum and Search --> : error C2143: syntax error : missing ';' before 'type'


shri1609
May 24th, 2010, 05:06 AM
hi,

I am creating a GUI using VC++ as compiler, i have all C files. In one of the file where i created blank windows frame work(i created blank window). for write pixel i'm using a function(as application needs). so i included following function in windos frame work code and i'm getting the error :
error C2143: syntax error : missing ';' before 'type'
error C2059: syntax error : '}'

function
extern void Line(Coord,Coord,Coord,Coord,Color)
{
int x1,y1,xe1,ye1;
MoveToEx(hDC,xe,ye,NULL);
LineTo(hDC,x,y);
}

i am getting first error at start of function, and 2nd at end of the function line.

hoxsiew
May 24th, 2010, 07:18 AM
What is "function"? That's not a C/C++ keyword or any standard library typedef that I know of.

shri1609
May 24th, 2010, 11:09 PM
i am using function Line(Coord,Coord,Coord,Coord,Color) to draw some graphic. I know we can draw lines and all using msdn library(LineTo) directly. but my application need it to draw through function Line.

hoxsiew
May 25th, 2010, 10:40 AM
I don't have any idea what you are trying to do, but try removing the word "function". It's not a C/C++ keyword (I think it is in PASCAL).

S_M_A
May 25th, 2010, 02:04 PM
No, PASCAL functions can't have void returns (at least not in the 15-20 year old PASCAL version I remember...) :)

hoxsiew
May 25th, 2010, 04:09 PM
My parenthetical remark was ambiguous. I meant that "function" is a valid keyword in PASCAL. I should have prhased it: "(I think it is a keyword in PASCAL)".

I suspect that the OP is confusing the two languages.

S_M_A
May 25th, 2010, 04:15 PM
Ah! No, that was my bad reading. I totally mis-interpreted it, I see that now reading it a second time. :blush: