I’m having the next kind of error when linking the application:
undefined reference to 'MyStructure::K_VARIABLE_A
undefined reference to 'MyStructure::K_VARIABLE_B
...
The structure is defined inside “MyStructure.h” as:
struct MyStructure
{
const static int K_VARIABLE_A=1;
const static int K_VARIABLE_B=2;
...
}
How can i get rid of this error?
My source code compiles successfully for Windows platform but I get the error mentioned above when compiling for the android platform.
The header of this structure is properly included in the .cpp file.
Thanks in advance.
The preferred way to define constant values in the scope of a class/struct is this: