This section describes the LabWindows/CVI Run-Time Engine, compatible external compilers for Linux, and programming guidelines for Linux applications.
The LabWindows/CVI development environment contains many built-in libraries, such as the User Interface Library and Utility Library. LabWindows/CVI also provides these libraries in the form of a stand-alone shared library called the LabWindows/CVI Run-Time Engine. All executables that call LabWindows/CVI library functions use the Run-Time Engine shared library.
You can use the GNU C Compiler (gcc), an external ANSI C compiler, to compile source files for linking with the LabWindows/CVI Run-Time Engine shared library.
If your program calls any functions from the LabWindows/CVI libraries, you must call InitCVIRTE to initialize the libraries from the executable. This function takes three arguments. The first and third arguments to this function must always be 0 for UNIX applications. The second must be the same value as the second parameter of your main function. InitCVIRTE returns 0 if it fails.
You do not have to call InitCVIRTE when you run your program in the LabWindows/CVI development environment because LabWindows/CVI always initializes the libraries. However, if you do not call InitCVIRTE, your executable cannot work. For this reason, National Instruments recommends that you always include source code similar to the following example in your program.
int main(int argc, char *argv[])
{
if (InitCVIRTE(0, argv, 0) == 0) {
return 1;/* Failed to initialize */
}
/* your program code here */
}
If you pass NULL for the second argument to InitCVIRTE, your program might still work, but with the following limitations: