y****e 发帖数: 23939 | 1 This line of code:
static int k_means_cont_table_(int * grp1, int * grp2, int * stb, long s1,
long s2, int flag);
always report error:
error C2143: syntax error : missing ')' before 'constant'
error C2143: syntax error : missing ';' before 'constant'
error C2059: syntax error : ')'
error C2238: unexpected token(s) preceding ';'
If I comment out this line and the corresponding code in cpp, then it
compiles OK. I checked it again and again, it looks innocent. What could be
the reason for this erro | t****t 发帖数: 6806 | 2 把前后三行贴出来看
be
【在 y****e 的大作中提到】 : This line of code: : static int k_means_cont_table_(int * grp1, int * grp2, int * stb, long s1, : long s2, int flag); : always report error: : error C2143: syntax error : missing ')' before 'constant' : error C2143: syntax error : missing ';' before 'constant' : error C2059: syntax error : ')' : error C2238: unexpected token(s) preceding ';' : If I comment out this line and the corresponding code in cpp, then it : compiles OK. I checked it again and again, it looks innocent. What could be
| y****e 发帖数: 23939 | 3 // k-means helper
static Dict min_dist_real(EMData* image, const vector& data);
static Dict min_dist_four(EMData* image, const vector& data);
static int k_means_cont_table_(int* grp1, int* grp2, int* stb, long int s1,
long int s2, int flag);
// new code common-lines
static vector cml_weights(const vector& cml);
【在 t****t 的大作中提到】 : 把前后三行贴出来看 : : be
| t****t 发帖数: 6806 | 4 error C2143: syntax error : missing ')' before 'constant'
error C2143: syntax error : missing ';' before 'constant'
error C2059: syntax error : ')'
error C2238: unexpected token(s) preceding ';'
I don't see symbol "constant" anywhere. which line is the error message
refering to?
s1,
【在 y****e 的大作中提到】 : // k-means helper : static Dict min_dist_real(EMData* image, const vector& data); : static Dict min_dist_four(EMData* image, const vector& data); : static int k_means_cont_table_(int* grp1, int* grp2, int* stb, long int s1, : long int s2, int flag); : // new code common-lines : static vector cml_weights(const vector& cml);
| y****e 发帖数: 23939 | 5 Exact this line in my original post:
static int k_means_cont_table_(int * grp1, int * grp2, int * stb, long s1,
long s2, int flag);
That's what puzzled me. I comment out this function, then nothing wrong.
【在 t****t 的大作中提到】 : error C2143: syntax error : missing ')' before 'constant' : error C2143: syntax error : missing ';' before 'constant' : error C2059: syntax error : ')' : error C2238: unexpected token(s) preceding ';' : I don't see symbol "constant" anywhere. which line is the error message : refering to? : : s1,
| t****t 发帖数: 6806 | 6 1. type that line again. don't copy/paste.
2. do you think you could have some macro intruding this line?
try use cpp to see what the compiler really saw.
【在 y****e 的大作中提到】 : Exact this line in my original post: : static int k_means_cont_table_(int * grp1, int * grp2, int * stb, long s1, : long s2, int flag); : That's what puzzled me. I comment out this function, then nothing wrong.
| y****e 发帖数: 23939 | 7 I have tried 1.
I also doubted macro, tried to change function name and variable name.
What do you mean "use cpp to see what the compiler really saw". Howcan I
do it?
Thank you very much.
【在 t****t 的大作中提到】 : 1. type that line again. don't copy/paste. : 2. do you think you could have some macro intruding this line? : try use cpp to see what the compiler really saw.
| t****t 发帖数: 6806 | 8 try to use cl.exe /E to compile.
【在 y****e 的大作中提到】 : I have tried 1. : I also doubted macro, tried to change function name and variable name. : What do you mean "use cpp to see what the compiler really saw". Howcan I : do it? : Thank you very much.
| c*******u 发帖数: 1269 | 9 put following into one line
static int k_means_cont_table_(int* grp1, int* grp2, int* stb, long int s1,
long int s2, int flag); | P********e 发帖数: 2610 | 10 does this matter?
most our codes do things like this.
put following into one line
static int k_means_cont_table_(int* grp1, int* grp2, int* stb, long int s1,
long int s2, int flag);
【在 c*******u 的大作中提到】 : put following into one line : static int k_means_cont_table_(int* grp1, int* grp2, int* stb, long int s1, : long int s2, int flag);
|
|