LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

If cvi can not support "extern" keyword ?

Hello ,

I have programmed such like codes :
//func1.c:
extern int something ;
void func1(void)
{
....;
func2();
}

//func2.c
static int something ;
void func2()
{
....;
something = 100;
....;
func3();
}

//func3.c
extern int something ;
void func3(void)
{
........
}

when building the program ,it always show a wrong message :"Project link errors ,Undifined symbol 'something' referenced in "func1.c " and "func3.c" . I'd like to know if CVI would not support the "extern" keyword ?

David
0 Kudos
Message 1 of 2
(3,041 Views)
Of course CVI supports extern.

If you declare a variable as 'static' (outside of a function), that means that the scope of the variable is local to the source file in which it is declared. So in this case, your 'func2.c' is faulty: you should omit the 'static' specifier:

int something;

--
Martin
--
Martin
Certified CVI Developer
Message 2 of 2
(3,041 Views)