06-19-2018 02:16 AM
I define a structure
typedef struct
{
char g_sUDP_HostAddress[MAX_ADDRESS_LEN];
char g_sUDP_ClientAddress[MAX_ADDRESS_LEN];
int g_iUDP_ReadPort;
int g_iUDP_WritePort;
double g_dMaxCurrentComsumption_A;
double g_dOperatingVoltage_V;
int g_iPSU1TestWaitTime;
double g_dTestVoltage_33V;
double g_dTestVoltage_16V;
int g_iRLY3152TestWaitTime;
int g_iRLY2114TestWaitTime;
int g_iRLY2662TestWaitTime;
double g_dAIO1OutputVoltage_V;
double g_dAIO1InputVoltage_V;
int g_iAIO1TestWaitTime;
int g_iDIO1TestWaitTime;
int g_iAIO1LogicOutputVoltage_V;
int g_iCATALYSTTestWaitTime;
} Test_Parameter_t;
Test_Parameter_t Test_Parameter;
In another file I pass a member of the structure as an argument
extern Test_Parameter; SetVoltage ( Test_Parameter.g_dOperatingVoltage_V );
While compiling I get an error:
error: member reference base type 'int' is not a structure or union
How do I fix the problem?
Solved! Go to Solution.
06-19-2018 02:50 AM
Hi,
with
extern Test_Parameter;
you are declaring an int with name Test_Parameter and external linkage.
You need to add the type:
extern Test_Parameter_t Test_Parameter;
06-19-2018 03:32 AM
Thx!