• It sounds like you probably have a problem on the prior line of code: the compiler was expecting a declaration, instead it encountered a function call. So... 1- Is your statement inside a function? 2- Is the function properly declared, with parentheses closed? 3- Can you insert the following prior to the failure, and does it compile? int x; x = x+1; 4- Are you missing a semicolon on the prior text? Generally, these kinds of "what the hell is the compiler talking about" questions are an indicator that something is wrong PRIOR to the point where the compiler got confused.
  • Look here at a similar problem: (the error is actually in the line *before*)
  • In my case this error happend, when I wanted to refer to a typedef struct _structure1 structure1 before it was actually defined, however everything have looked okay. this was of course a fault. PROBLEM DESCRIPTION: in header_a.h i've had similar to: #include "header_a_dep1.h" #include "header_a_dep2.h" #include "header_a_dep3.h" in one /header_a_dep..h/ I had included "header_a.h" HOW: the problem was because in one of the /header_a_dep..h/ headers I DID have reference to structure definition pointer that was actually defined AFTER this reference. (typedef struct _structure1 structure1) WHY: compiler complained about a parameter of function prototype in header_a_dep3.h. header_a_dep3.h DID have included header_a.h where this structure has been defined, BUT: in header_a.h #include "header_a_dep3.h" was stated BEFORE (typedef struct _structure1 structure1)

Copyright 2020, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy