Hello petrean,
Something you may not be understanding or understanding well is how your "#define"s are working. Along with a thought that really caught my attention after seeing
jonnin
's response.
Given the code:
1 2 3 4 5 6 7 8 9 10 11 12
|
#include <iostream>
#define CLS mstd::cls() // <--- Note no semi-colon here.
int main()
{
CLS; // <--- Semi-colon used here.
// <--- Other code.
return 0;
}
|
When you compile the code, and if I understand correctly, the preprocessor will make note of the "#define" and when it finds something after the "#define" it will replace it before the compiler compiles the code.
So what the compiler actually sees when the preprocessor is done is:
1 2 3 4 5 6 7 8 9 10 11 12
|
#include <iostream>
#define CLS mstd::cls() // <--- Note no semi-colon here.
int main()
{
mstd::cls();
// <--- Other code.
return 0;
}
|
Now what your program is doing is defining a complete function using the "#define" and when you reach a line like:
Date_SetDay_v(DATE_pst, DAY_u8);
you are defining an inline function in your code replacing
Date_SetDay_v(DATE_pst, DAY_u8)
with the entire function and ending the function with a semi-colon that you do not need.
If you error message refers to a line of code in main it is more likely referring to something in the macro that was expanded and that you do not see.
I have not noticed any missing semi-colon in the functions. There is the "return0;" that is missing a space and is not needed in the first place and that you end up with a semi-colon after the closing brace } of the function that is not needed.
Sorry without the missing header files there is no way to test this without completely rewriting the program.
Hope that helps,
Andy