PRAGMAS Two `#pragma' directives are supported for GNU C++, to permit using the same header file for two purposes: as a definition of interfaces to a given object class, and as the full definition of the contents of that object class.
#pragma interface (C++ only.) Use this directive in header files that define object classes, to save space in most of the object files that use those classes. Nor- mally, local copies of certain information (backup copies of inline member functions, debugging infor- mation, and the internal tables that implement vir- tual functions) must be kept in each object file that includes class definitions. You can use this pragma to avoid such duplication. When a header file containing `#pragma interface' is included in a compilation, this auxiliary information will not be generated (unless the main input source file it- self uses `#pragma implementation'). Instead, the object files will contain references to be resolved at link time.
#pragma implementation
#pragma implementation "objects.h" (C++ only.) Use this pragma in a main input file, when you want full output from included header files to be generated (and made globally visible). The included header file, in turn, should use `#pragma interface'. Backup copies of inline mem- ber functions, debugging information, and the in- ternal tables used to implement virtual functions are all generated in implementation files.
If you use `#pragma implementation' with no argu- ment, it applies to an include file with the same basename as your source file; for example, in `allclass.cc', `#pragma implementation' by itself is equivalent to `#pragma implementation "allclass.h"'. Use the string argument if you want a single implementation file to include code from multiple header files.
There is no way to split up the contents of a sin- gle header file into multiple implementation files.
文件說明 file.c C source file file.h C header (preprocessor) file file.i 經預處理過的 C source file file.C C++ source file file.cc C++ source file file.cxx C++ source file file.m Objective-C source file file.s assembly language file file.o object file a.out link edited output TMPDIR/cc* temporary files LIBDIR/cpp preprocessor LIBDIR/cc1 compiler for C LIBDIR/cc1plus compiler for C++ LIBDIR/collect linker front end needed on some machines LIBDIR/libgcc.a GCC subroutine library /lib/crt[01n].o start-up routine LIBDIR/ccrt0 additional start-up routine for C++ /lib/libc.a standard C library, 參閱 man page intro(3) /usr/include standard directory for #include files LIBDIR/include standard gcc directory for #include files LIBDIR/g++-include additional g++ directory for #include
LIBDIR is usually /usr/local/lib/machine/version. TMPDIR comes from the environment variable TMPDIR (default /usr/tmp if available, else /tmp).