- Comeau C/C++ 4.3.3 is available for use with MS-Windows in a so-called "DOS box" (IDE integration is not yet possible, but something that we are working on). As with all non-custom ports since 4.0, Comeau C/C++ for MS-Windows costs $50.
It is available at that price for use with MS-Windows XP, MS-Windows 2000, MS-Windows NT, MS-Windows ME, MS-Windows 98 and MS-Windows 95 with only the C compilers detailed below.
See our main web page for other Comeau platforms, or if you need to tailor it for use with another C compiler, see customizations.
- Comeau C/C++ for MS-Windows has now been tailored for use with more C compilers. We feel that supporting these additional compilers will give folks an amazing flexibility of choice previously not possible. This will provide them a broad range of possibilities, including economically reasonable choices whether from say a budget minded student wanting to use it with a freely downloadable C compiler, to just somebody with different personal favorites, etc. etc.
Until now, Comeau C/C++ had been extensively tested with the C part of MS Visual C++. The tailored compilers supported now include:
Note that these are MINIMUM VERSION REQUIREMENTS. Using versions less than those shown, or using other C compilers, won't work and so will be a waste of your time. Contact us if you are not clear whether you have the correct version of a compiler or not, or if you have a compiler not shown above.
Although Comeau C/C++ can be tailored to generate native object code, all currently available ports generate C as their object code. As such, one or more C compilers have been extensively tested with each operating system it is available for. Furthermore, the generated C code is C compiler specific.
If you need to use Comeau C/C++ with another C compiler, then you need to contact us about a custom port (you will not be able to do it yourself as there are many dependencies throughout the Comeau C++ compile process that depend upon each other, depend upon being correct, and depend upon being done in a specific way and obviously Comeau Computing is the only entity who can change this). For some more information on this, see:
- Since there is now more than one backend available under Windows, there needs to be a way to choose which C compiler you want to use with Comeau C/C++, since you may actually have more than one installed. There are therefore new command line options available to allow you to control which C compiler you want to use:
- --vc71 (note two dashes) This requests that VC++ 7.1 be used as the backend C compiler.
- --vc7 (note two dashes) This requests that VC++ 7.0 be used as the backend C compiler.
- --vc (note two dashes, and that --vc6 will also work) This requests that VC++ up to and including 6.0 be used as the backend C compiler. This is the default if no explicit request is made and no default.??? file exists (see below), so therefore it does not need to be specified (although we may change this).
- --bcc (note two dashes) This requests that Borland C++ 5.x be used as the backend C compiler. As per above, this now also includes BCB6.
- --min (note two dashes, and that --mingw and --minGW will also work)
This requests that MinGW special gcc version 2.95.3-6 and above be used as the backend C compiler.
- --lcc (note two dashes)
This requests that lcc-win32 version "Feb 3 2002 09:47:54" and above be used as the backend C compiler.
- --dig (note two dashes)
This requests that Digital Mars version 8.26.3n and above be used as the backend C compiler.
- --mw (note two dashes)
This requests that MetroWerks CodeWarrior version 2.4.5 build 199 and above be used as the backend C compiler.
- Having so many choices to specify the C compiler in the previous bullet would mean that you have to always specify which compiler you want to use. Therefore, there is now an additional file based mechanism to control which compiler to choose:
- A file named default.vc71, which should be placed into your main Comeau directory. This requests that VC++ 7.1 be used as the backend C compiler if no command line option is specified.
- A file named default.vc7, which should be placed into your main Comeau directory. This requests that VC++ 7.0 be used as the backend C compiler if no command line option is specified.
- A file named default.vc (or default.vc6), which should be placed into your main Comeau directory. This requests that VC++ up to and including 6.0 be used as the backend C compiler if no command line option is specified. (This is currently equal to the default behavior, and so currently need not be specified if this is your situation. As per above, we may eventually change this behavior.)
- A file named default.bcc, which should be placed into your main Comeau directory. This requests that Borland C++ 5.x be used as the backend C compiler if no command line option is specified. As per above, this does not include BCB6.
- A file named default.min (or default.mingw),
which should be placed into your main Comeau directory.
This requests that MinGW special gcc version 2.95.3-6 and above be used as the backend C compiler if no command line option is specified.
- A file named default.lcc, which should be placed into your main Comeau directory.
This requests that lcc-win32 version "Feb 3 2002 09:47:54" and above be used as the backend C compiler.
- A file named default.dig, which should be placed into your main Comeau directory.
This requests that Digital Mars version C 8.26.3n and above be used as the backend C compiler.
- A file named default.mw, which should be placed into your main Comeau directory.
This requests that MetroWerks CodeWarrior version 2.4.5 build 199 and above be used as the backend C compiler.
- IMPORTANT NOTES to consider when requesting the backend C compiler:
- The last specified compiler on the command line "wins" as the requested C compiler.
- Command line option requests override the file requests. So, for instance, if you have a default.bcc file but specify --vc, then VC++ will be used. This means you should set up the "default-dot" file for the compiler you will be using most often.
- When there is no default-dot file specified, and no command line compiler requests, the default compiler is assumed to be VC++ (this may change, but is currently the default since that is the compiler the customer base has had up until this release). However, if there is no COMO_MS_INCLUDE environment variable set (see below) but there is a COMO_BCC_INCLUDE or COMO_MIN_INCLUDE or COMO_LCC_INCLUDE or COMO_DIG_INCLUDE or COMO_MW_INCLUDE(see below) environment variable set, then it will assume Borland or MinGW or lcc-win32 or Digital Mars or CodeWarrior, respectively, is the default compiler. If no environment variable is found, or more than one is possible, a warning will be emitted.
Also, if more than one default-dot file exists, then a warning is emitted and which is chosen is random (we expect this will change to be an error) if no command line option is specified. These last assumptions might be asking for too much, and so, we don't know if they will remain, especially if we add additional new backends.
- IMPORTANT NOTES on compiler clashes. These really have nothing to do with Comeau C/C++ per se, but just come up as issues to watch out for:
- If you need to use VC++ 6.0, VC++ 7.0 and VC++ 7.1, you will have to run them in independent DOS-boxes. Running vcvars32 for VC++ 6.0 won't get you capability to use 7.0, or vice versa. And remember to use the --vc71 or --vc7 when using Comeau C++ with 7.1 or 7.0, and do this when compiling with como and when linking with como.
- Digital Mars has an sc.exe command which competes with the sc command available on some versions of Windows, so you may need to put the DM bin directory path earlier in your PATH environment variable. Symptoms of this appear to be that como runs sc, and since it might be the Windows sc, then it await for input. So, como appearing to lock up means you need to rectify this. Of course, you can test this by typing sc at the command prompt, and see if it runs the DM compiler or the Windows service command.
- VC++ and Digital Mars both have link.exe, lib.exe, etc. commands. So, if you request Digital Mars be used as the backend C compiler, then its path must be before VC++'s in your PATH environment variable. Similarly, if you request VC++ as the backend C compiler, then its path must be before the path for Digital Mars. If not, you'll probably get a warning about:
C++ prelinker: warning: no output produced by nm -- possible configuration problem
or you might get a linker error.
Note that an executable might still be produced, and it might even start to execute if you run it, but it will probably malfunction, even if it completes execution. So if you get this warning, adjust your PATH and recompile.
como.exe tries to detect this, but it's not completely possible to do so. When it does detect it, it emits a diagnostic. As well, if you are suspicious that this might be the case, you can use the --check_link option (note that compilation is not completed when this option is specified) and it will tell you what it finds as possibilities. If the first path in the list is not as expected, then you'll need to adjust your PATH accordingly, as described above.
- A new version of libcomoTM, http://www.comeaucomputing.com/libcomo is also now available to support Comeau C/C++ 4.3.3. It is able to support Comeau C/C++ with VC++ 4.0-6.0, VC++ 7.0, MinGW, Borland, lcc-win32, Digital Mars and Metrowerks CodeWarrior backends. Note again that you may need to be upgrade your C compiler in order for it to be used with Comeau C++ and/or libcomo.
- Debugging? Comeau C/C++ can be used with your C compiler's debugger.
To enable debugging, you'll need to use the C compiler's command line switch as a "slash option" on your invocation of como. So, for instance, with Borland, instead of -v use /v.
Or, with Microsoft, you can compile with the /Zi command line option (specify these when compiling and when linking).
The respective debugger will display your C++ source code (or your C source in the case that you're using a C mode of Comeau C/C++). Note however that the name mangling formulas will be different between Comeau and the backend compiler. Therefore, if you want to set a breakpoint manually, then you will need to use the mangled Comeau name. On the other hand, you can set breakpoints graphically. For instance, with Microsoft, by right clicking your mouse, just like the way you would do it with any app. As well, you can manually breakpoint on a particular line, by entering, say with Microsoft, something such as:
{,YourFile.c,} .99 (where 99 is the line number) into the breakpoint window box input field. Note that name mangling is not an issue in C mode, or with extern "C"'d functions, so you can use those names directly, if you want, in addition to the above choices.
Debugging code generated with MinGW, Borland, lcc-win32, Digital Mars, or MetroWerks CodeWarrior as the backend is still something that we need to look into further, but should work similarly to VC++ and Borland. We welcome your feedback on this.
- Note that in the general online document that options accepting spaces should use an equal sign instead when used with Comeau C++ for Windows. The equal sign is also accepted in non-Windows versions for those worried about keeping make files or other tool information intact.
- MODES. Note that when you invoke Comeau C/C++ under Windows, it will tell you what mode it is in. If you look, you will see that under Windows, the default mode is not Comeau strict mode, or even Comeau relaxed mode, instead it depends upon your backend C compiler. For instance, with Microsoft, --microsoft is the default mode (as is --microsoft_bugs mode). This allows compatibility with the MS header files, etc.
Note that to use Comeau C/C++ in strict mode under MS-Windows do not just specify --no_microsoft and/or --no_microsoft_bugs, as that doesn't usually help much unless you don't use header files. Similarly, do not just specify the -A or -a option (note these have one dash).
Instead, to use Comeau C/C++ in strict mode under MS-Widows, use the --A or --a options (note these have two dashes) options. They will allow you to use many of the Microsoft, Borland, MinGW, lcc-win32, Metrowerks CodeWarrior and Digital Mars header files in strict mode, as well as those from libcomo. We have not tested it with every header file though, so some may still be problematic. Please report those that are.
Note as well that some of the Borland and MetroWerks header files do not end in a newline, so you may find you cannot use --A and instead must use --a (unless you actually go in and add a newline to the Borland or Metrowerks header files that have this problem). Similarly, you may want to choose --a if you want to use something like long long. New since 4.3.0.1 though is that you can specify --long_long (as an extension) while in strict mode.
Use of these options also mean that --wchar_t, -D_WCHAR_T_DEFINED and --no_microsoft_bugs are no longer necessary to have to explicitly specify on the command line.
As well, if libcomo gets automatically established as described below, you don't have to explicitly specify libcomo paths any longer either.
Since the 4.2.45.2 "c" releases, in most cases, all you have to specify to como is the file name simplifying your command lines and makefiles!
Note too that new options --no_A and --no_a are supported. This might be handy if you are using an @ file (another new feature, see below).
Last but not least, see below for C compiler header file changes that may be necessary.
- In order to effectively use como under MS-Windows, which is found in \<YourComeauDir>\bin\como.exe, you will need to set the following environment variables (Note: Each of the below is one line, however, your browser may line wrap them giving the appearance that an environment variable is on a line by itself -- it isn't):
set PATH=....;Drive:\YourComeauDir\bin;...
set COMO_XXX_INCLUDE=Drive:\YourCIncludeDir
where XXX is described below. You may also optionally set:
set COMO_LIB_BASE=Drive:\WhereLibcomoIs
set COMO_INCLUDE=Drive:\Dir1;Drive:\DirN
set TMPDIR=Drive:\SomeWriteableTemporaryDirectory
set COMO_BASE=Drive:\YourComeauDir
Environment variable notes:
- The order of includes is -I's, COMO_INCLUDE, COMO_BASE\include, COMO_MS_INCLUDE
- You will also need to add Drive:\<YourComeauDir>\bin to your PATH environment variable. So, COMO_BASE contains the topmost Comeau C++ directory whereas the Comeau C++ "bin" directory gets added to PATH.
- Also, if como invokes MSVC++, you will need cls directory in your PATH too.
- You will need to set your MSVC++ LIB environment variable appropriately too, if VC++ is used.
Don't add any Comeau paths to LIB though.
- See below if you need an alternative <winnt.h> for use with VC++ 6.0
Environment variable notes:
Environment variable SAMPLE SETUPS:
- Here's a minimal sample setting for using Comeau C++ with MinGW 2.95.3-5
rem MinGW 2.95.3-5's main include directory
set COMO_MIN_INCLUDE=e:\mingw.2.95.3-5\include
rem Add Comeau bin to PATH
set PATH=%PATH%;e:\tmp\como432\bin
rem Add MinGW 2.95.3-5's bin to PATH
set Path=e:\mingw.2.95.3-5\bin;%PATH%
rem libcomo is installed in e:\tmp\como432\libcomo
rem Under this setup COMO_LIB_BASE is not needed
rem But you need to run "makeit min" from the libcomo directory
Note that the use of all environment variables discussed earlier is not necessary. For instance, note that COMO_BASE and TMPDIR are not specifically set, and normally that is just fine.
Note the location of MinGW 2.95.3-5 on your system will be different.
- Here's a minimal sample setting for using Comeau C++ with VC++ 6.0
rem Needed for VC6, independent of Comeau
set INCLUDE=C:\PROGRA~1\MIAF9D~1\VC98\ATL\INCLUDE;C:\PROGRA~1\MIAF9D~1\VC98\INCLUDE;C:\PROGRA~1\MIAF9D~1\VC98\MFC\INCLUDE
set LIB=C:\PROGRA~1\MIAF9D~1\VC98\LIB;C:\PROGRA~1\MIAF9D~1\VC98\MFC\LIB
rem VC6's main include directory
set COMO_MS_INCLUDE=C:\PROGRA~1\MIAF9D~1\VC98\INCLUDE
rem Add Comeau bin to PATH
set PATH=%PATH%;e:\tmp\como4301\bin
rem Add VC6 bin to PATH
set Path=%PATH%;C:\PROGRA~1\MIAF9D~1\VC98\BIN
rem libcomo is installed in e:\tmp\como4301\libcomo
rem Under this setup COMO_LIB_BASE is not needed
rem But you need to run "makeit vc" from the libcomo directory
Note that the use of all environment variables discussed earlier is not necessary.
Note the location of VC6.0 on your system will be different and may be set up via your VC6.0 vcvars32 command, if that's how you set up VC6.0 on your system, so it may set up INCLUDE, LIB and PATH for you.
- Here's a minimal sample setting for using Comeau C++ with VC++ 7.0
rem Needed for VC7.0, independent of Comeau
set INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\VC7\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio .NET\VC7\INCLUDE;C:\Program Files\Microsoft Visual Studio .NET\VC7\PlatformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .NET\VC7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;C:\PROGRA~1\MIAF9D~1\VC98\ATL\INCLUDE;C:\PROGRA~1\MIAF9D~1\VC98\INCLUDE;C:\PROGRA~1\MIAF9D~1\VC98\MFC\INCLUDE;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\
set LIB=C:\Program Files\Microsoft Visual Studio .NET\VC7\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio .NET\VC7\LIB;C:\Program Files\Microsoft Visual Studio .NET\VC7\PlatformSDK\lib\prerelease;C:\Program Files\Microsoft Visual Studio .NET\VC7\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;C:\PROGRA~1\MIAF9D~1\VC98\LIB;C:\PROGRA~1\MIAF9D~1\VC98\MFC\LIB;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\
rem VC7.0's main include directory
set COMO_MS_INCLUDE=c:\progra~1\micros~1.net\vc7\include
rem Add Comeau bin to PATH
set PATH=%PATH%;e:\tmp\como4301\bin
rem Add VC7.0 bin to PATH
set PATH=C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;%PATH%
rem libcomo is installed in e:\tmp\como4301\libcomo
rem Under this setup COMO_LIB_BASE is not needed
rem But you need to run "makeit vc7" from the libcomo directory
Note that the use of all environment variables discussed earlier is not necessary.
Note the location of VC7.0 on your system will be different and may be set up via your VC7.0 vsvars32 command, if that's how you set up VC7.0 on your system, so it may set up INCLUDE, LIB and PATH for you.
- Here's a minimal sample setting for using Comeau C++ with VC++ 7.1;
it is assuming Comeau is installed at g:\como438 and that libcomo is in that install tree, and VC++ 7.1 is installed at f:\Program Files\Microsoft Visual Studio .NET 2003 (aka f:\progra~1\micros~3.net\vc7):
rem Needed for VC7.1, independent of Comeau
set INCLUDE=f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\INCLUDE;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\INCLUDE;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include\prerelease;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\include;f:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include;
set LIB=f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\ATLMFC\LIB;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\LIB;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib\prerelease;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib;f:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\lib;
rem VC7.0's main include directory
set COMO_MS_INCLUDE=f:\progra~1\micros~3.net\vc7\include
rem Add Comeau bin to PATH
set PATH=g:\como438\bin;%PATH%
rem Add VC7.1 bin to PATH
set Path=f:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;f:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN;f:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools;f:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin\prerelease;f:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;f:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin;f:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;%PATH%
rem VC++ 7.1 also needs some other environment variables:
set DevEnvDir=f:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
set FrameworkDir=f:\WINDOWS\Microsoft.NET\Framework
set FrameworkSDKDir=f:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1
set FrameworkVersion=v1.1.4322
set MSVCDir=f:\Program Files\Microsoft Visual Studio .NET 2003\VC7
set VCINSTALLDIR=f:\Program Files\Microsoft Visual Studio .NET 2003
set VS71COMNTOOLS="f:\progra~1\micros~3.net\vc7\include\..\..\common7\tools\"
set VSINSTALLDIR=f:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
rem libcomo is installed in g:\como438\libcomo
rem Under this setup COMO_LIB_BASE is not needed
rem But you need to run "makeit vc71" from the libcomo directory
Note that the use of all environment variables discussed earlier is not necessary.
Note the location of VC7.1 on your system will be different and may be set up via your VC7.1 vsvars32 command, if that's how you set up VC7.1 on your system, so it may set up INCLUDE, LIB and PATH for you.
- Here's a minimal sample setting for using Comeau C++ with Metrowerks
rem Needed for Metrowerks, independent of Comeau
set CWFolder=C:\Program Files\Metrowerks\CodeWarrior
set LM_LICENSE_FILE=C:\Program Files\Metrowerks\CodeWarrior\license.dat
set MWCWinx86Includes=+C:\Program Files\Metrowerks\CodeWarrior\MSL;+C:\Program Files\Metrowerks\CodeWarrior\Win32-X86 Support;C:\Program Files\Metrowerks\CodeWarrior\MSL\MSL_C\MSL_Common\Include;C:\Program Files\Metrowerks\CodeWarrior\Win32-X86 Support\Headers\Win32 SDK;
set MWWinx86Libraries=+C:\Program Files\Metrowerks\CodeWarrior\MSL;+C:\Program Files\Metrowerks\CodeWarrior\Win32-x86 Support;
set MWWinx86LibraryFiles=MSL_C_x86.lib;MSL_Extras_x86.lib;MSL_Runtime_x86.lib;MSL_C++_x86.lib;gdi32.lib;user32.lib;kernel32.lib;
rem Metrowerks main C include directory
set COMO_MW_INCLUDE=c:\Program Files\Metrowerks\CodeWarrior\MSL\MSL_C\MSL_Common\include
rem Add Comeau bin to PATH
set PATH=%PATH%;e:\tmp\como4301\bin
rem Add Metrowerks bin's to PATH
set PATH=C:\Program Files\Metrowerks\CodeWarrior\Bin;C:\Program Files\Metrowerks\CodeWarrior\Other Metrowerks Tools\Command Line Tools;C:\Program Files\Metrowerks\CodeWarrior\Win32-x86 Support\Libraries\Runtime\Libs\MSL_All-DLLs;%PATH%
rem libcomo is installed in e:\tmp\como4301\libcomo
rem Under this setup COMO_LIB_BASE is not needed
rem But you need to run "makeit mw" from the libcomo directory
Note that the use of all environment variables discussed earlier is not necessary.
Note the location of Metrowerks on your system will be different.
- To invoke Comeau C/C++ under MS-Windows, you will use the como command. Please use it to compile your source files.
The default name of the resulting executable produced is aout.exe.
Comeau C++>como file.cpp
Comeau C++>aout
Comeau C++>como file1.cpp file2.cpp
Comeau C++>aout
To compile only, without linking, use the -c command line option:
Comeau C++>como xyz.c Compile and link
Comeau C++>como -c xyz.c Compile only, results in xyz.obj
Do not confuse this with the --c (note two dashes not one) option which specifies C90 mode. So if you want to compile but not link a C90 source you'd write:
Comeau C++>como -c --c c.c
Note that you must also use como when link'ing your object files.
Comeau C++>link xyz.obj Don't do this, this is an error
Comeau C++>como xyz.obj Compile xyz.obj into aout.exe
To override the default file name, use the -o option. For instance:
Comeau C++>como xyz.c
Comeau C++>aout
<Output here>
Comeau C++>como -o abc xyz.c
Comeau C++>abc
<Output here>
Comeau C++>como -c a.cpp b.cpp
Comeau C++>como -o xyz a.obj b.obj
Comeau C++>xyz
Do not use a file extension with -o:
Comeau C++>como -o abc.exe xyz.c Don't do this
And do note that there is whitespace after -o, so this is not allowed:
Comeau C++>como -oabc xyz.c
Support for -o'ing to different directories and -o'ing of object files is now available. This option expects the burden of specifying proper file extensions for object files to be upon you.
Mixing compiler is not fruitful:
Comeau C++>como -c --vc71 xyz.cpp
Comeau C++>como --bcc xyz.obj Don't do this
Mixing languages should be ok so long as you're using the same backend C compiler and you've used extern "C", etc.
Comeau C++>como -c --c99 cpart.c
Comeau C++>como -c cpppart.cpp
Comeau C++>como cpart.obj cpppart.obj Should be ok
Comeau C++>aout
- As with when you use Microsoft VC++'s cl by itself, your compile using Comeau C/C++ may produce the following linker diagnostic:
LINK: warning LNK4224: /DEBUGTYPE:BOTH is no longer supported; ignored
This means that you need to specify that you're using VC++ 7.x as the backend C compiler (via either the --vc71 or --vc7 command line option or the default.vc71 or default.vc7 control file). If you don't, the linker might still create an executable but it will be erroneous.
As well, note that if you get the following message:
LINK : fatal error LNK1561: entry point must be defined
This means that you are missing a main(). Using with a MinGW gcc backend might produce:
undefined reference to `WinMain@16'
and means the same thing. Similarly for some of the other compilers. Note that some C compilers will still create the executable file and even mark it executable, so don't run it, as it will no doubt not be a good thing to do.
- Do note that Comeau C++ makes every effort to support the language features of Standard C++. Depending upon which source you are compiling, you may or may not have to enable or disable exception handling (-x, --no_exceptions), the bool data type (--bool, --no_bool), or wide-characters (--wchar_t, --no_wchar_t), etc. That said, Comeau C/C++ for Windows is in its "microsoft mode" by default. See the discussion earlier
- Sometimes is it desirable to capture the output of a command. This is often done with I/O redirection, for instance:
como xyz.c > output
Here, only standard output is sent to the file named output.
The problem here is that command.com does not allow redirection of standard error. In order to allow this, you may specify the -% option to como, whereas standard error is sent to wherever standard output is being sent to. Consider:
como -% xyz.c > output
In this case, all diagnostics are sent to the file named output.
We should also note that NT's command processor cmd.exe does allow redirection of standard error. As well, note that in a .BAT file that % is a special character, therefore in a .bat file you need to use -%%.
- Some source files may produce warnings that you may want to silence. To get rid of a specific diagnostic:
- First, do a como run and specify --display_error_number. On a respective diagnostic, it might show #123-D, so the error number would be 123.
- Then, use that number (without the -D) to suppress the diagnostic, using --diag_suppress, for instance, --diag_suppress=123
If you want to get rid of all warnings, then use --no_warnings.
Note that you can only suppress a diagnostic with a -D on the error number. If it does not have a -D then you cannot suppress that particular diagnostic.
Note also that for MS-Windows, there must be an equal sign between the suppress option and its argument, and there can be no spaces before or after the equal sign.
Note also that you can specific multiple suppressions with multiple --diag_suppresses, for instance:
--diag_suppress=1 --diag_suppress=9 --diag_suppress=111
or together seperated by commas (again with no embedded spaces):
--diag_suppress=1,9,111
- As with when you use Microsoft VC++'s cl by itself, your compile using Comeau C/C++ may produce the following linker diagnostic:
LINK : fatal error LNK1104: cannot open file "LIBC.lib"
This means that you need to provide a definition for your MSVC++ LIB environment variable, which is needed to point at the MSVC++ library path. This is necessary for using a routine from Standard C, such as printf. Often this might be done by running vcvars32.bat from your MS bin directory, or however you have VC++ set up.
You have to set up some additional environment variables with Metrowerks CodeWarrior too, but you should not have this concern when using Comeau C++ with the Borland, MinGW, lcc-win32 or Digital Mars backends. If you do, please contact us.
- If you get a diagnostic along the lines of:
Failure while executing 'XXX' compiler ...email Comeau for advice
You should double check that you've made the shadow header file changes as detailed below.
Additionally, there are some cases where parameter names are used in inline assember code. Here, the parameter names become mangled, but as inline assemble is not C++, the two names end up being different, and then the underlying C code generates an error. In such cases, it may be best to use stack offsets (displacements from the stack pointer) instead of the C++ identifier names of the parameters.
If neither of these seem to be the case, definitely contact us with your details.
- If you have MSVC++, you will have a problem with some header files:
- If you are using Borland as the C backend, you are expected to add a shadow file for _stddef.h into the include\bcc directory
(so you might have c:\como430\include\bcc\_stddef.h).
Add this similar to the procedure described for Microsoft above.
Look for the lines which set __STD whether __cplusplus is set or not.
Change that block of code to this:
#if defined(__COMO__)
#undef __STD /* Just in case ctype.h already included */
#ifdef __cplusplus
#define __STD std /* Establish libcomo's definition */
#else
#define __STD
#endif
#else
/* The original code block here, from the #ifdef to the #endif */
#endif
- If you are using MinGW's gcc as the C backend, you are expected to add a shadow file for float.h, winnt.h, rpcdcep.h and winsock.h into the include\min directory.
Add this similar to the procedure described for Microsoft above.
- Add a float.h:
#ifndef __COMO_MIN_FLOAT_H
#define __COMO_MIN_FLOAT_H
#include_next <float.h>
#undef DBL_EPSILON
#undef LDBL_EPSILON
#define DBL_EPSILON 2.2204460492503131E-16
#define LDBL_EPSILON 2.2204460492503131E-16
#endif
Note that include_next will not work when --A is specified. If you need that, then you'll need to make a full shadow copy and then change the DBL_EPSILON and LDBL_EPSILON definitions in the shadow version.
- In rpcdcep.h, change the prototype for I_RpcAllocate to:
void __stdcall *I_RpcAllocate(unsigned int);
- In winsock.h, change the following prototypes to these forms:
char * PASCAL inet_ntoa(struct in_addr);
...
struct hostent * PASCAL gethostbyaddr(const char*,int,int);
struct hostent * PASCAL gethostbyname(const char*);
struct servent * PASCAL getservbyport(int,const char*);
struct servent * PASCAL getservbyname(const char*,const char*);
struct protoent * PASCAL getprotobynumber(int);
struct protoent * PASCAL getprotobyname(const char*);
- In winnt.h, change the definition of GetCurrentFiber(void) to:
__asm mov eax, fs:[0x10]
return 0;
and the definition of GetFiberData(void) to:
__asm { mov eax, fs:[0x10]
mov eax,[eax]
}
return 0;
- If you are using Digital Mars as the C backend, this release expects you to add a shadow file for assert.h, stdio.h, float.h and win32\winnt.h into the include\dig directory.
Add this similar to the procedure described for Microsoft above.
-
Use of the assert macro ends up internally requiring void * arguments, which isn't right in C++ strict mode, so you'll notice that toward the end of assert.h a prototype of _assert taking two void *'s and an unsigned, you'll want to change that in the shadow into:
_assert(const char *, const char *, unsigned);
Leave the __cdecl and such alone.
Also, comment out the next line which reads:
#pragma noreturn(_assert)
- In stdio.h, change the typedef of va_list from char * to void *.
Note: This change does not seem necessary for DigitalMars 8.34 and above.
Also, a few lines down from the typedef for va_list in stdio.h, there is declarations for vwprintf, vfwprintf, swprintf, vswprintf each one line after the other. Wrap those 4 lines with an #ifndef __COMO__ ... #endif
- In float.h, after the #if/#else/#endif where LDBL_MIN_EXP is set, add this:
#ifdef __COMO__
#undef DBL_EPSILON
#undef DBL_MAX
#undef DBL_MIN
#undef FLT_MAX
#undef FLT_MIN
#undef FLT_EPSILON
#undef LDBL_EPSILON
#undef LDBL_MAX
#undef LDBL_MIN
#define DBL_EPSILON /*0x1p-52*/ /*2.22045e-16*/ 2.2204460492503131E-16
#define DBL_MAX /*0x1.FFFFFFFFFFFFFp1023*/ 1.79769e+308
#define DBL_MIN /*0x1p-1022*/ /*2.22507e-308*/ 2.2250738585072014e-308
#define FLT_MAX /*0x1.FFFFFEp+127*/ 3.40282e+38
#define FLT_MIN /*0x1p-126*/ 1.17549e-38
#define FLT_EPSILON /*0x1p-23 / * 1.19209290e-7f */ 1.19209e-07
#define LDBL_EPSILON /*0x1p-63L*/ (DBL_EPSILON + 0.0L)
#define LDBL_MAX /*0x1.FFFFFFFFFFFFFFFEp+16383L*/ (DBL_MAX+0.0L)
#define LDBL_MIN /*0x1p-16382L*/ (DBL_MIN+0.0L)
#endif
- In win32\winnt.h, follow the instructions for changing winnt.h for VC++, just being clear that it's going into include\dig\win32\winnt.h of your Comeau install directory in this case.
Note: This change does not seem necessary for DigitalMars 8.34 and above.
- If you are using Metrowerks CodeWarrior as the C backend, this release expects you to add a shadow file for cmath and math_config.h into the include\mw directory.
Add this similar to the procedure described for Microsoft above.
Note that we've already provided some header files for you that will automatically be in your Comeau installation. You should not need to change those already available.
- In cmath:
- In math_config.h, there is an include of AMD_K63DNow_math.h wrapped by a #if checking for __option(k63d). Comment out the #if block including the #include.
- If you are using lcc-win32 as the C backend, this release currently does not expect you to add any shadow files into the include\lcc directory (they are included for you automatically in your Comeau installation).
- Some additions to como.exe
are enumerated below:
- ... - October 2003 additions
- Specifying -M for make file dependency capability works as it did previously. However, there are now new arguments that you can specify to extend its capability:
- Modified with D (-MD) is the default, and the same as -M
- Modified with another M (-MM) it does not output "system include directories", including eliding any subdirectories of those directories.
- Modified with U (-MU), uses so-called UNIX style path names, so \'s are changed to /'s, since many make commands and "shells" process backslashes as escape characters.
- Modified with $ (-M$), it emits $$ if a $ is found in the path.
- Modified with Q (-MQ), it double quotes the whole path if it contains a space.
- Modified with E (-ME), it escapes spaces. If E and Q appear together, E wins.
- Notes: Modifiers can appear in any order. So, for instance, you may have: -MME$ You should also be able to accumulate options, for instance, -MM -M$ -ME .
Modifiers should influence the output of both the targets and their dependencies.
Unknown modifiers should be diagosed as "invalid option"
Note that there is a new command line option under MS-Windows to internally recognize use of the Dinkumware library, which gets effected by -M'ing. See next bullet.
The above descriptions may still not be the final form.
- In order to streamline -M processing, and also as an ease of use issue, use of the --dinkumware or --dinkum option can now be specified. There is also a --no_dinkumware and --no_dinkum option to turn it off. If active, use of libcomo is turned off.
Upon activation of the Dinkumware option, como will see if Dinkumware is installed in your Comeau directory tree, in a directory named dinkumware. If so, it will automatically pick up the directory. In this case, the use of COMO_DINKUMWARE_BASE described below should not be used.
If the COMO_DINKUMWARE_BASE environment variable is detected, como will query it for the location of the Dinkumware libraries in order that its path can be recognized as a "system include" (it expects the "top most" dinkumware directory to be specified, so for instance, use e:\dinkumware NOT e:\dinkumware\include).
This above capability means that there is a mechanism whereby the Dinkumware path can be implicitly added to your compilations. This is not yet available for UNIX or LINUX versions of Comeau C++.
Options that Dinkumware normally requires are automatically added when used with VC++, Borland, and MinGW backends. As well, como will now automatically add the .lib for linking. It assumes you're using the C99/Standard version of the Dinkumware lib. So, for instance, if you are specifying use of a VC++ backend, it would use como_vc_c99_standard.lib, in C++ and C mode.
The above descriptions may still not be the final form.
- August 2001-August 2002 additions
- Many features discussed above
- Enhancement whereas object code and executables built are now smaller.
- Enhancement whereas C modes and template instantiation now build faster..
- Using --no_exceptions while using libcomo will now use "NX" versions of the libcomo .lib files. This means you must also build libcomo flavors with --no_exceptions specified to makeit.bat.
- Supports a --prelink_objects option which lets you establish a closure on template instantiations to be used before putting the object files into a library (so you won't get a link error like you saw previously when you compiled libcomo, or any other library).
- Supports a --prelink_verbose option (or --plv for short), which is the default, which can be disabled with --no_prelink_verbose (or --no_plv for short). When enabled, prelinker instantiation messages are emitted.
- Support for the COMO environment variable, which is expected to contain command line options.
- Support for @responsefile files, which contain command line options. This takes two forms:
- At compile startup, a special file named default, in your Comeau install directory, is checked for automatically. If it exists, it is used as an implicit @ file.
- As a command line option, specifying an @file, which can be a full or partial pathname, so long as it exists, is readable, and is accessible from the directory you're compiling from.
This means the order of options processing is:
- If a default-dot file is specified (see above), it requests the respective default backend C compiler to use. So, for instance, if default.vc exists, it is as if --vc has been specified.
- Options specified in the file named default from your Comeau install directory. This is a handy place to specify whether you want strict mode, relaxed mode, or microsoft mode. It can also be handy to specify which compiler you want as the default as well. Of course, you can specify any option here.
- Options specified in the COMO environment variable.
- Options specified on the command line.
- If a command line option is an @ file, its options are processed. This is a handy place to put project specific options. When the @file has been processed, options from the command line are resumed.
Some considerations follow:
- Discussions of "command line" in this document should consider the ordering described above, since it extends to the other forms mentioned too.
- In cases where template instantiation time is at "link time", @ files have already been processed, and so the options they contained will be used, and not the @ files. This should have no impact (we're just noting it because the @ files don't need to exist in such cases).
- Spaces in the @ file start a new option. This means quoted options can't be used.
- An @ file can't invoke another @ file.
- You shouldn't use an @ file to override a default-dot file, use an actual command line option for this instead.
- Supports a --help (or -? or /help or /?) option which lets you see common options to Comeau C/C++.
- Supports a -! command line option, allowing for remote diagnostics. This creates a file named snapshot which can be sent as a binary email attachment.
- Supports a -v option (ONE DASH!!) which emits the version of Comeau C/C++ that is being used. Note that Comeau C/C++ normally outputs version information, so this option is only expected to be used when there are no files specified.
- Supports a --stlfilt option, which invokes Leor Zolman's "STL Error Decryptor" for use with Comeau C++. This assumes you've installed his application and have perl in your PATH.
See http://www.bdsoft.com/tools/stlfilt.html for more details on STLFilt, including how to obtain the Perl script.
You can pick up ActivePerl at: http://activestate.com/Products/Download/Get.plex?id=ActivePerl.
STLFilt'ing assumes comofilt.pl exists in your Comeau install directory.
If not, use --stlfilt=pathname, so you might have --stlfilt=c:\xyz\filtit.pl.
STLFilt options can be passed after the filename, via commas, so you might have --stlfilt=,/width:0,-iter:s. Note that here, the default file name is being used and that stlfilt options are specified via / or -. Also, if you only pass options, the equal-sign is optional, so you might have --stlfilt/width:0
--no_stlfilt is also supported (perhaps you've put --stlfilt into the default file).
- Supports a --unsigned_char option which lets you control whether chars are unsigned by default. (Enabled for Microsoft or Borland currently.)
- Supports a --time_stamp option which lets you see when como.exe was built.
- Numerous additional warnings are now emitted if you are not using Comeau C/C++ properly (like missing an environment variable, or one with incorrect data).
- July 2001 additions (version 4.2.45.2b)
- An enhancement to template instantiation, fixing an instantiation loop
- A fix to re-allow debugging using the MS debugger (recognizing /Zi etc)
- A fix in the code that allows spaces in environment variables and command line options
- Environment variables may now end in a \
- Recognizing environment variables beginning with COMO_
- May 16 2000 additions:
- The full path names of files being compiled may now be used on the command line. The previous version required you to be in the same directory as the file.
- November 17 1999 additions:
- For transparent compatibility, if certain environment variable's values starts with a double quote, then that quote, and a possibly matching ending double quote, are removed from the value (this occurs within como only).
- For transparent compatibility, if certain environment variable's values is used in a path name of a command to be executed, and it contains so-called forward slashes, then they are changed into backward slashes (this occurs within como only).
- November 12 1999 additions:
- Appropriate diagnostics when a process cannot be executed.
Have you found a glitch in