Chapter 3 Windows 95/NT Compiler/Linker Issues
LabWindows/CVI Programmer Reference Manual 3-10
©
National Instruments Corporation
If you use an external compiler that requires a WinMain entry point, the following optional
library allows you to define only
main in your program.
cviwmain.lib /* contains a WinMain() function which */
/* calls main() */
Include Files for the ANSI C Library and the LabWindows/CVI Libraries
The cvirt.lib import library contains symbols for all the LabWindows/CVI libraries,
except the ANSI C standard library. When you create an executable or DLL in an external
compiler, you use the compiler’s own ANSI C standard library. Because of this, you must use
the external compiler’s include files for the ANSI C library when compiling source files.
Although the include files for the other LabWindows/CVI libraries are in the
cvi\include
directory, the LabWindows/CVI ANSI C include files are in the
cvi\include\ansi
directory. Thus, you can specify
cvi\include as an include path in your external compiler
while at the same time using the external compiler’s version of the ANSI C include files.
Note
Use the external compiler’s ANSI C include files only when you compile a source
file that you intend to link using the external compiler. If you intend to link the file
in LabWindows/CVI, use the LabWindows/CVI ANSI C include files. This is true
regardless of which compiler you use to compile the source file.
For more information, refer to the Setting Up Include Paths for LabWindows/CVI, ANSI C,
and SDK Libraries section later in this chapter.
Standard Input/Output Window
One effect of using the external compiler’s ANSI C standard library is that the printf and
scanf functions do not use the LabWindows/CVI Standard Input/Output window. If you
want to use
printf and scanf, you must create a console application, which is called a
character-mode executable in Watcom.
You can continue to use the LabWindows/CVI Standard Input/Output Window by calling the
FmtOut and ScanIn functions in the Formatting and I/O library.
Resolving Callback References from .UIR Files
When you link your program in LabWindows/CVI, LabWindows/CVI keeps a table of the
non-static functions that are in your project. When your program calls
LoadPanel or
LoadMenuBar, the LabWindows/CVI User Interface Library uses this table to find the
callback functions associated with the objects you load from the user interface resource
(
.uir) file. This is true whether you run your program in the LabWindows/CVI development
environment or as a standalone executable.
00ProRef.book : 06chap03.fm Page 10 Monday, March 9, 1998 3:23 PM