LabWindows/CVI

Content Type
Programming Language
Current manual

External Compiler Support

Build»External Compiler Support

Use the External Compiler Support command to help you build your project in an external compiler.

Note  To compile code within the LabWindows/CVI environment using an external compiler, specify the compiler in the Active 32-bit compiler or Active 64-bit compiler option in the Build Options dialog box.

The External Compiler Support dialog box contains the following options:

  • UIR Callbacks—Creates an object or source file for you to link into your executable or DLL. The object or source file contains a list of the callback functions you specify in the .uir files in your project. When you load a panel or menu bar from the .uir file, the User Interface Library uses the list to link the objects in the panel or menu bar to their callback functions in your executable or DLL. If you specify callback function names in your .uir file(s), set UIR Callbacks to Source File, enter the name of the source file to create, and click Create. In the future, whenever you save modifications to any of the .uir files in the project, LabWindows/CVI automatically updates the source file.

    You must call the InitCVIRTE function at the beginning of your main, WinMain, or DLLMain function so that LabWindows/CVI run-time libraries can initialize the list of names from the source file. If you create a DLL and any of your callback functions are defined in but not exported by the DLL, you must call LoadPanelEx or LoadMenuBarEx (rather than LoadPanel or LoadMenuBar) from the DLL.
  • Using LoadExternalModule to Load Object and Static Library Files—Enables the section of the dialog box that you use when creating an executable or DLL that calls the Utility Library LoadExternalModule function to load object or static library files.

    Notes
    • LoadExternalModule is obsolete. In addition, when you use LoadExternalModule in a program that you build with an external compiler, the linker might not be able to resolve some of the symbols. The particular version of the external compiler you are using determines what symbols can cause a problem.
    • This option is not necessary if you use LoadExternalModule to load only DLLs that you load through DLL import libraries.

    Unlike DLLs, object and static libraries can contain unresolved external references. When you use LoadExternalModule to load an object or static library file, LabWindows/CVI resolves these references using symbols in your executable or DLL or in previously loaded external modules. Consequently, the names of the symbols in your executable or DLL that are necessary to resolve these references must be available to the LoadExternalModule function.
  • CVI Libraries—Provides information that LoadExternalModule requires when your run-time modules reference symbols in any of the following LabWindows/CVI libraries:
    • User Interface Library
    • RS-232 Library
    • DDE Support Library
    • TCP Support Library
    • Formatting and I/O Library
    • Utility Library
    If you use one of these libraries, include in your external compiler project the source file displayed in this indicator. This option does not apply if you use LoadExternalModule to load only DLLs.
  • ANSI C Library—Provides information that LoadExternalModule requires when your run-time modules reference symbols in the ANSI C Library. Include in your external compiler project the source file displayed in this indicator. This does not apply if you use LoadExternalModule to load only DLLs.
  • Other Symbols—Creates an object file for you to link into your executable or DLL. Select this option if your run-time modules refer to symbols other than those covered by the previous two options. Such symbols include functions or variables that you define globally in your executable or DLL and to which your object or static library run-time modules expect to link.
    • Header File—Insert the name of an include file that contains complete declarations of all the symbols necessary to resolve references from run-time modules.
    • Object File—Enter the name of the object file to create. Click Create to create the file. You must include this file in your external compiler project.

The bottom of the External Compiler Support dialog box contains a list of library files to include in your external compiler project. Include the following files, which are located in the msvc and msvc64 folders of the CVIversion\extlib directory.

  • cvirt.lib
  • cvisupp.lib
  • cviwmain.lib

Use cviwmain.lib only when the external compiler requires you to define WinMain, when you do not define it in your project, and when any of the libraries the external compiler automatically links do not define it. In general, console applications do not require WinMain. GUI application wizards sometimes automatically include it in the source code they generate.

Was this information helpful?