home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c031 / 1.ddi / ANSWERS.TX$ / answers
Encoding:
Text File  |  1992-03-10  |  12.8 KB  |  313 lines

  1.  
  2.                               ANSWERS.TXT File
  3.  
  4.        Commonly Asked Questions About Microsoft(R) C/C++, Version 7.0
  5.  
  6.                   (C) Copyright Microsoft Corporation, 1992
  7.  
  8.      This document contains answers to common questions posed by
  9.      first-time users of Microsoft C/C++ version 7.0 and its libraries
  10.      for MS-DOS(R) and Microsoft Windows(TM) operating systems.
  11.  
  12.  
  13. ================================< Contents >================================
  14.  
  15.  
  16.      This file is divided into three parts:
  17.  
  18.                Part     Title
  19.                ----     -----
  20.                1        Setup and Configuration Questions
  21.  
  22.                2        Compiler and Languages Questions
  23.  
  24.                3        Documentation Questions
  25.  
  26.  
  27. ================< Part 1: Setup and Configuration Questions >===============
  28.  
  29.  
  30.      Q: How can I set up my system to ensure the fastest
  31.         possible compile times?
  32.  
  33.      A: Here are four tips for fast compiling:
  34.  
  35.        1. Use Precompiled Headers
  36.  
  37.           Because the compiler spends a lot of time processing 
  38.           header files, precompiled headers can speed compilation 
  39.           significantly, especially when used with the fast compile 
  40.           option. This speed increase is particularly important when 
  41.           you include large header files, such as WINDOWS.H or the 
  42.           Microsoft Foundation Class header files.
  43.  
  44.           Three compiler options let you take advantage of precompiled 
  45.           headers: /Yc (create precompiled header), /Yu (use precompiled 
  46.           header), and /Yd (include debugging information). 
  47.  
  48.           For details, see Chapter 2, "Using Precompiled Header Files," 
  49.           in the "Programming Techniques" manual.
  50.  
  51.        2. Use the Fast Compile Option
  52.  
  53.           The fast compile option (/f) increases compilation speed by
  54.           eliminating some of the optimizations performed in a release
  55.           compilation. During the development phase of a project, when
  56.           execution speed is less important than build time, these fast 
  57.           compilations can dramatically boost your productivity. As a 
  58.           given portion of code stabilizes, you can use the optimizing 
  59.           compiler to obtain faster, smaller code.
  60.  
  61.           The fast compile option is on by default if you do not select 
  62.           any optimizations (the /O options). Explicitly disabling 
  63.           optimizations using the /Od option also implies /f.
  64.  
  65.           Note: The fast compile option does not impose capacity 
  66.           limitations on the optimizing compiler. 
  67.  
  68.           See the README.TXT file for the most current information on the 
  69.           fast compile option.
  70.  
  71.        3. Use a Disk Caching Program
  72.  
  73.           Microsoft C/C++ includes SMARTDRV 4.0, a sophisticated disk 
  74.           caching program that significantly outperforms earlier versions 
  75.           of SMARTDRV. The new SMARTDRV is installed in your AUTOEXEC.BAT 
  76.           file by the Microsoft C/C++ Setup program. You should use 
  77.           SMARTDRV 4.0 in place of earlier versions. 
  78.  
  79.           SMARTDRV 4.0 dramatically speeds up compile and link times 
  80.           compared to other disk caching programs.
  81.  
  82.           Using RAMDRIVE.SYS to create one or more RAM drives may limit the 
  83.           memory assigned to your SMARTDRV cache. For best system 
  84.           performance, consider assigning more memory to SMARTDRV and less
  85.           to RAMDRIVE. SMARTDRV 4.0 is more flexible and efficient in the
  86.           way it uses memory than RAMDRIVE under such conditions. 
  87.  
  88.        4. Use a RAM Disk Program
  89.  
  90.           If you don't use SMARTDRV 4.0, try using a RAM disk program, such 
  91.           as RAMDRIVE.SYS, to store the compiler's intermediate files in 
  92.           RAM instead of on disk. 
  93.  
  94.           To use this RAM disk, be sure to specify its drive designator in 
  95.           the TMP environment variable. To learn more about setting 
  96.           environment variables, see Chapter 3, "Configuring Your System," 
  97.           in the "Getting Started" manual. 
  98.  
  99.  
  100.      Q: How do I copy a single file from the installation disks onto
  101.         my machine?
  102.  
  103.      A: There are two ways to copy a single file from the installation
  104.         disks. One method is to use the Setup program that installs
  105.         C/C++ for MS-DOS only. The other method is to use the DECOMP
  106.         utility provided with the Profiler.
  107.  
  108.         To use the MS-DOS Setup program:
  109.  
  110.         1. Exit the Windows environment.
  111.  
  112.         2. Insert Disk1 into drive A.
  113.  
  114.         3. Type A:CSETUP.EXE and select the "Copy a file from the
  115.         distribution disks" option.
  116.  
  117.         4. Follow the instructions for installing one or more files.
  118.  
  119.         To use the DECOMP utility provided on the Profiler Disk 1
  120.         installation disk, use the following syntax:
  121.  
  122.         DECOMP srcFile destFile
  123.  
  124.         where srcFile is the file (or files) to be copied and
  125.         destFile is the destination on your hard disk. For additional
  126.         information, type DECOMP /? at the command line to see Help
  127.         on the DECOMP utility.
  128.  
  129.  
  130.      Q: Since the /double_buffer option used with SMARTDRV.EXE can slow
  131.         performance in some instances, how can I determine if I really
  132.         need it?
  133.  
  134.      A: The Setup program always installs SMARTDRV.EXE with the 
  135.         /double_buffer option. To determine if this option is needed
  136.         on your computer, see the information on SMARTDRV.EXE that begins 
  137.         on page 25 of the "Getting Started" manual. 
  138.  
  139.  
  140.      Q: When I press CTRL+C at a linker prompt, LINK does not
  141.         terminate. Why not?
  142.  
  143.      A: After you press CTRL+C, press ENTER. The program then 
  144.         terminates. Pressing the ENTER key is necessary because 
  145.         DOS-extended programs respond differently to CTRL+C at an 
  146.         input prompt than do MS-DOS programs. This is most likely to 
  147.         occur when using the linker, but it can also occur at an input 
  148.         prompt in any DOS-extended program. DOS-extended programs in 
  149.         C/C++ 7.0 include the compiler, linker, CVPACK,MPC, and BSCMAKE.
  150.  
  151.  
  152. ================< Part 2: Compiler and Languages Questions >=================
  153.  
  154.  
  155.      Q: I'm trying to use object files that I compiled with a previous
  156.         version of Microsoft C, but I'm getting LINK error "L2029:
  157.         unresolved external" for the run-time library functions. What's
  158.         wrong?
  159.  
  160.      A: For full ANSI compatibility, all non-ANSI run-time functions,
  161.         constants, variables, typedefs, structures, and macros in the
  162.         new Microsoft include files begin with a single underscore (_).
  163.  
  164.         However, not all non-ANSI symbols in older Microsoft C 
  165.         include files began with an underscore. For example, since
  166.         the function named "read" in older Microsoft include files is
  167.         not an ANSI function, it is now named "_read." Your old object
  168.         file contains symbols that do not begin with the correct
  169.         number of underscores.
  170.  
  171.         The solution is to use the new OLDNAMES.LIB library, which
  172.         contains alias records that map the old names to the new names
  173.         (for example, "read" maps to "_read"). This aliasing happens
  174.         at link time so there is no time or space overhead in the
  175.         resulting executable file. Only programs that use non-ANSI
  176.         symbols require linking with OLDNAMES.LIB.
  177.  
  178.         For more information about OLDNAMES.LIB, see "ANSI
  179.         Compatibility" on page x of the "Introduction" to the "Run-Time
  180.         Library Reference" manual.
  181.  
  182.  
  183.      Q: I'm trying to build an MFC sample program and I get a compilation
  184.         error stating that WINDOWS.H cannot be found. What should I do?
  185.  
  186.      A. The Windows 3.1 Software Development Kit contains the necessary
  187.         files. Run the installation program for the SDK.
  188.  
  189.  
  190.      Q: When building an MFC sample program, the compiler generates an 
  191.         error regarding redefinition of NEAR, FAR, and CDECL. What
  192.         does this mean?
  193.  
  194.      A. The compiler is accessing the wrong version of WINDOWS.H. Make sure
  195.         you are using the version of WINDOWS.H that shipped with C/C++.
  196.  
  197.  
  198.      Q: I'm trying to link C++ object files with C object files, but I'm
  199.         getting LINK error "L2029: unresolved external" for some of my
  200.         functions. What's wrong?
  201.  
  202.      A: If you are going to call C functions from a C++ module, you must
  203.         declare those C functions as extern "C" in the C++ module. If you
  204.         are going to call C++ functions from a C module, you must declare
  205.         those C++ functions as extern "C" in the C++ module.
  206.  
  207.         If you are writing a DLL in C++, you must also declare all
  208.         exported functions as extern "C".
  209.  
  210.  
  211.      Q: When PWB is building my application, CTRL+C does not cancel the
  212.         build. Why not?
  213.  
  214.      A: Your CONFIG.SYS file needs the statement BREAK=ON for CTRL+C
  215.         to be recognized. 
  216.  
  217.  
  218.      Q: Does Microsoft C/C++ support 32-bit programming?
  219.  
  220.      A: The current version of the compiler does not support 32-bit
  221.         programming. However, 32-bit programming will be supported
  222.         in a future release of the compiler.
  223.  
  224.  
  225.      Q: Is the Microsoft implementation of C++ fully compliant with the
  226.         ANSI draft specification for the C++ language?
  227.  
  228.      A: Microsoft C++ is fully compliant with "The Annotated C++
  229.         Reference Manual" by Ellis & Stroustrup (published by Addison-
  230.         Wesley Publishing Company), with two exceptions: a class must be 
  231.         defined before a pointer to member of that class can be declared, 
  232.         and local classes are not supported (local classes without member 
  233.         functions are treated as global classes, and local classes with 
  234.         member functions generate the compiler error "C2601: functions 
  235.         cannot be defined in local classes").
  236.  
  237.  
  238.      Q: Does Microsoft C/C++ support templates (parameterized types)?
  239.  
  240.      A: The current version of the compiler does not support templates.
  241.         Templates will be supported in a future release of the
  242.         compiler.
  243.  
  244.         The Microsoft Foundation Classes provide an example program
  245.         named TEMPLDEF.CPP, which implements a subset of the template
  246.         facility. For more information about this example program, see
  247.         the contents of the directory \C700\MFC\SAMPLES\TEMPLDEF and
  248.         the file TN004.TXT in the directory \C700\MFC\DOC. (The MFC
  249.         directories are present only if you chose to install the
  250.         Microsoft Foundation Classes when running Setup.) Note that
  251.         this program is only an example, and the syntax it supports
  252.         may change in the future.
  253.  
  254.  
  255.      Q: Does Microsoft C/C++ support exception handling?
  256.  
  257.      A: The current version of the compiler does not support exception
  258.         handling. Exception handling will be supported in a future
  259.         release of the compiler.
  260.  
  261.         The Microsoft Foundation Classes provide an exception-handling
  262.         facility that is similar to the one proposed by the ANSI
  263.         committee. For more information about this facility, see
  264.         Chapter 12 of the "Class Libraries User's Guide", and the
  265.         CException class in the "Class Libraries Reference."
  266.  
  267.  
  268. ====================< Part 3: Documentation Questions >=====================
  269.  
  270.  
  271.      Q: Where can I find a summary of the compiler options and
  272.         other new features included in Microsoft C/C++ version 7.0?
  273.  
  274.      A: See Chapter 1 of "Getting Started," and Appendix C of the
  275.         "C Language Reference."
  276.  
  277.  
  278.      Q: The documentation set is so large--how can I find what I'm
  279.         looking for?
  280.  
  281.      A: There is a topical overview of the Microsoft C/C++ documentation 
  282.         in Chapter 1 of "Getting Started." You might also want to spend 
  283.         a few minutes browsing through the comprehensive index (a combined
  284.         index to all the C/C++ books) in the "Comprehensive Index and 
  285.         Errors Reference" manual.
  286.  
  287.  
  288.      Q: Where is the Windows documentation?
  289.  
  290.      A: The Microsoft Foundation Classes provide classes for writing
  291.         Windows programs in C++. You can find information on these
  292.         classes in the "Class Libraries User's Guide" manual, the "Class
  293.         Libraries Reference" manual, and in Help.
  294.  
  295.         When you install the Windows 3.1 SDK, you can request that Help
  296.         be installed for the Windows programming tools. Unless you 
  297.         request different directory locations during installation, the
  298.         help files can be found in C700\HELP and in C700\BIN.
  299.  
  300.  
  301.      Q: Where can I find a list of the errors returned by the
  302.         compiler and utilities?
  303.  
  304.      A: See the "Comprehensive Index and Errors Reference" manual
  305.         or Help.
  306.  
  307.  
  308. ============================================================================
  309.  
  310.  
  311.      Microsoft, MS, and MS-DOS are registered trademarks, and Windows is a
  312.      trademark of Microsoft Corporation.
  313.