National Instruments NI-488.2 Time Clock User Manual


 
Chapter 3 Developing Your Application
© National Instruments Corp. 3-17 NI-488.2 User Manual for Windows
Compiling, Linking, and Running Your Application
The following sections describe how to compile, link, and run your application program.
To see examples that show how to include specific lines of code in your program, refer to
the program examples included with your NI-488.2 software.
If you discover errors when you execute the program refer to Chapter 4, Debugging Your
Application. If you want to verify the NI-488 and NI-488.2 calls made by your
application, you can use GPIB Spy, the GPIB applications monitor for Windows
described in Chapter 6, GPIB Spy.
Microsoft C
Before you compile your C application program, make sure that the following line is
included at the beginning of your program:
#include "windecl.h"
After you have written your C application program, you must compile your application
program using one of the following compilers: Microsoft C Version 7.0 with Microsoft
SDK (Software Development Kit) Version 3.1 or Microsoft Visual C++ Version 1.0 (also
known as Microsoft C Version 8.0). Then link your application with the C language
interface, gpib.lib. Use the following command to compile and link a QuickWin C
application named cprog using Microsoft C:
cl /Mq cprog.c gpib.lib
The /Mq option of Microsoft C creates a QuickWin application. To run your application,
choose the Run option from the File menu in the Program Manager window. Enter the
path and name of the compiled program in the dialog box that pops up.
Borland C++
Before you compile your C application program, make sure that the following line is
included at the beginning of your program:
#include "windecl.h"
After you have written your C application program, you must compile your application
program using the Borland C++ (version 2.0 or higher) compiler. Then link your
application with the C language interface, gpib.lib. Use the following command to
compile and link a Windows C application named cprog using Borland C++:
bcc -W cprog.c gpib.lib
The -W option of Borland C++ creates a Windows application. To run your application,
choose the Run option from the File menu in the Program Manager window. Enter the
path and name of the compiled program in the dialog box that pops up.