From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-22-2005 03:07 PM
11-23-2005 01:52 AM
I usually put all macros, typedefs, structs, variables and function definitions that are global to the whole application in an include file that I #include in every source that is part of the project, the same as I need to #include common files like userint.h and cvirte.h and the include files associated to your UIRs
11-23-2005 03:34 AM
As Roberto says, it is good practice to put common definitions in a header file which is #included by all your C source files. Note that this should only have definitions, not statements that actually generate code. So for example it should contain function prototypes, not function definitions. This will avoid the multiple function definition problems you had. Similarly, you can define variables that are to be used between modules as extern in the include file: this will allow all modules to be aware that the variable exists and can be linked to, but only one of the source files should then declare the actual instance of the variable.
JR
11-23-2005 02:44 PM
11-23-2005 02:53 PM