National Instruments 320685D-01 ユーザーズマニュアル

ページ / 211
©
 National Instruments Corporation
5-1
LabWindows/CVI Programmer Reference Manual
5
UNIX Compiler/Linker Issues
This chapter describes the kinds of compiled modules available under LabWindows/CVI for 
UNIX and includes programming guidelines for modules you generate with external 
compilers.
Calling Sun C Library Functions
You can call functions in the Sun Solaris C libraries from source code in LabWindows/CVI. 
LabWindows/CVI automatically links your program to the following static libraries, located 
in the 
/usr/lib
 directory, when you build the project.
Solaris 1: 
libm.a, libc.a
Solaris 2: 
libsocket.a, libnsl.a, libintl.a, libm.a, libc.a
When you create a standalone executable, LabWindows/CVI invokes the Sun Solaris link 
editor (
ld
) to link your program to the LabWindows/CVI dynamic library and to the system 
libraries. By default, the Sun Solaris link editor uses the dynamic versions of the libraries. 
LabWindows/CVI passes the following linking options to the Sun Solaris link editor:
Solaris 1: 
-lm -ldl -lc
Solaris 2: 
-lsocket -lnsl -lintl -lm -lthread -lc
In general, you can use the header files that Sun provides for these libraries in the 
/usr/include
 directory. For the ANSI C functions, however, use the header files that come 
with LabWindows/CVI.
Restrictions on Calling Sun C Library Functions
You cannot call any Sun C Library function that uses data types incompatible with the 
LabWindows/CVI compiler or libraries. In particular, you must not call functions that use the 
long
 
double
 data type. In LabWindows/CVI the 
long
 
double
 data type has 8 bytes, but the 
Sun libraries expect a 16-byte object.
Under Solaris 2, you must not call any function that uses the 
long
 
long
 data type. 
LabWindows/CVI does not recognize this non-ANSI type.
00ProRef.book : 06chap05.fm  Page 1  Monday, March 9, 1998  3:23 PM