LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

linking problem betn two C Files

 
I face a linker problem in my program .Here I have 2 .C files betn these two one contains main() function . Now I call a user defined function from main () .The function body i.e definition is in second C file but declaration is in first .C file . During run time its giving "Multiply symbol
 _X in A.c and B.c ". Where X =Name of the user-defined function .
                                             A.c & B.c are two C Files .
 
Please reply whats wrong and how to recover from this problem ?
 
subrata
0 Kudos
Message 1 of 2
(2,910 Views)
The problems you are seeing derive on the function being defined in both C files: the compiler detects this conditions and raises an error.
You must change the declaration in the source file with main () function to be a referencing declaration by adding the extern keyword.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,900 Views)