error: C4430 and error: C2440:
-
I get the following error when building with gt 5.10. I would appreciate your feedback.
error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error: C2440: 'initializing': cannot convert from 'initializer list' to 'int'The piece of code that causes the above error. I used the type specifier double and float but still it did not work.
unsigned char UM; //All input-output uses this unit of measure: only the grid has its own specific unit of measurement. UM_description; UM_descriptions[UM_DESCRIPTION_COUNT]= { //Use as a base unit the 1/100 of thou (10 ^ -5 inch) which corresponds to 0.254 micrometers {"mm", 3937.0, 3}, //1000.0, //0 {"inch", 100000.0, 5}, //25400.0, //1 {"thou", 100.0, 2}, //25.4, //2 {"metre",3937000.0,6}, //1000000.0, //3 {"cm", 39370.0, 4}, //10000.0, //4 {"micron",3.937, 0} //1.0, //5 };
I get the following error when I used the float specifier for UM_descriptions
error: C2440: 'initializing': cannot convert from 'initializer list' to 'float'
I get the following error when I used the double specifier for UM_descriptions
error: C2440: 'initializing': cannot convert from 'initializer list' to 'double'
-
Hi and welcome to devnet,
What compiler are you using ?
What is this UM_description structure ?
-
I get the following error when building with gt 5.10. I would appreciate your feedback.
error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error: C2440: 'initializing': cannot convert from 'initializer list' to 'int'The piece of code that causes the above error. I used the type specifier double and float but still it did not work.
unsigned char UM; //All input-output uses this unit of measure: only the grid has its own specific unit of measurement. UM_description; UM_descriptions[UM_DESCRIPTION_COUNT]= { //Use as a base unit the 1/100 of thou (10 ^ -5 inch) which corresponds to 0.254 micrometers {"mm", 3937.0, 3}, //1000.0, //0 {"inch", 100000.0, 5}, //25400.0, //1 {"thou", 100.0, 2}, //25.4, //2 {"metre",3937000.0,6}, //1000000.0, //3 {"cm", 39370.0, 4}, //10000.0, //4 {"micron",3.937, 0} //1.0, //5 };
I get the following error when I used the float specifier for UM_descriptions
error: C2440: 'initializing': cannot convert from 'initializer list' to 'float'
I get the following error when I used the double specifier for UM_descriptions
error: C2440: 'initializing': cannot convert from 'initializer list' to 'double'
I used the type specifier double and float but still it did not work.
Given that you're asking about compiler error messages, could we see the
actual
code you are compiling when you get a message? People post here who do all sorts of things....In a word, your syntax is wrong. Nothing to do with Qt.
Your line which reads simply:
UM_description;
What is that line doing there, with no further reference to
UM_description
? If I didn't know better, I'd wonder whether you really mean...UM_description UM_descriptions[UM_DESCRIPTION_COUNT]=
...And then your whole initializer list might make sense.... Because as it is now, using
float
ordouble
is going to make no difference anywhere. You're not understanding/specifying what that is an array of, and the compiler doesn't know, hence the message:error: C2440: 'initializing': cannot convert from 'initializer list' to 'int'
To be specific, it's actually for your inner initializers. Compiler has told you it's expecting an array of
int
s. Instead it sees "an initializer list". -
Hi and welcome to devnet,
What compiler are you using ?
What is this UM_description structure ?
-
I get the following error when building with gt 5.10. I would appreciate your feedback.
error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error: C2440: 'initializing': cannot convert from 'initializer list' to 'int'The piece of code that causes the above error. I used the type specifier double and float but still it did not work.
unsigned char UM; //All input-output uses this unit of measure: only the grid has its own specific unit of measurement. UM_description; UM_descriptions[UM_DESCRIPTION_COUNT]= { //Use as a base unit the 1/100 of thou (10 ^ -5 inch) which corresponds to 0.254 micrometers {"mm", 3937.0, 3}, //1000.0, //0 {"inch", 100000.0, 5}, //25400.0, //1 {"thou", 100.0, 2}, //25.4, //2 {"metre",3937000.0,6}, //1000000.0, //3 {"cm", 39370.0, 4}, //10000.0, //4 {"micron",3.937, 0} //1.0, //5 };
I get the following error when I used the float specifier for UM_descriptions
error: C2440: 'initializing': cannot convert from 'initializer list' to 'float'
I get the following error when I used the double specifier for UM_descriptions
error: C2440: 'initializing': cannot convert from 'initializer list' to 'double'
-
@VBsFAN
In my response above I have already told you what is wrong: your code is wrong, you have no type, or an incorrect type, for yourUM_descriptions
array. You can ask all the questions you want, but until you fix that it's not going to compile, anywhere....