www.digitalmars.com Home | FAQ | News Groups | Books | DMC++ | Nerdly Stuff
Last update Mon Apr 7 22:57:13 2008

Documentation
· Compiler & Tools Guide
· Runtime Library Reference
· IDDE Reference
· Change Log
· FAQ

Downloads
· C/C++ compiler
· D compiler
· DMDScript compiler
· MicroEmacs
· MTask

Community
· Forums
· News Groups
· Archives

· Bookshelf
· Features
· Contact
· News Digest
· Friends
· Related Sites
· Acknowledgements
· Consultants
· Site Map
· Walter Bright
· Empire

Frequently Asked Questions


Can I get it on CD?

    CD now available! It's very reasonably priced at 5 plus S&H.

Where's the debugger?

    The CD version includes the DMC++ debugger. Alternatively, you can use any debugger that works with the Microsoft CodeView format or linker .MAP format. These include the:
    • Symantec debuggers
    • Zortech debuggers
    • Microsoft debuggers (Codeview, symdeb, windbg, VC++ debugger). Instructions for windbg.
    • Rational Systems debuggers
    • Multiscope debuggers
    Remember to compile with the -g option (generate symbolic debug info) and link with /co/ma.

Where's the IDDE?

    The CD version includes the DMC++ Integrated Developing and Debugging Environment (IDDE). Alternatively, the Microemacs editor, included in the free download version, is a fully capable and powerful text editor.

What's the version of the compiler?

    The version number of the package is given by the filename starting with 'v' in the \dm directory. Individual programs in \dm\bin may have different version numbers. The version of the compiler itself can be found by typing:
    \dm\bin\scppn
    
    at the command prompt.

When I click on it, a window flashes and disappears?

    This happens when the program is a console program. Console programs are meant to be run from the command prompt. Most of the non-IDDE Digital Mars programs are console programs. A command prompt window can be created on XP by clicking on [Start][Command Prompt].

The compiler gives me an error when accessing a base class?

With the code:
template <class T> struct Base
{
      int m_member;
};

template <class T> struct Derived : public Base<T>
{
      Derived() : m_member(0)
      {
      }
};
the compiler gives an error that the m_member or any other members of Base<T> are not found. Although other compilers accept such code, it is incorrect according to the C++98 Standard 14.6.2-2 and 14.6.2.1-1. Base<T> is a dependent type, and so it is not in scope for template class Derived.

Can I download the documentation in one zip file?

    All the documentation comes on the CD as html files, as well as the Microsoft API documentation in Windows Help format.

Is DOSX still available?

    DOSX is now re-released as X32 for the Digital Mars compilers, and is now available again! Download the patch for X32, and X32 itself. If you need the old Symantec or Zortech dos extender version, and you have an original licensed copy of the Zortech or Symantec compilers, copy these files:
    lib\sdx.lod
    lib\cx.obj
    src\dos32\cx.asm
    src\dos32\lib\x386.lib
    
    into the same directories and then you can develop for DOSX again.

Does the WDOSX (Wuschel's DOS eXtender) work with DMC?


Is the Zed editor still available?


Will the compiler run under DOS?

    No. Although the compiler will build 16 bit DOS programs, the compiler itself will only run under Win32. The dos extended versions of the tool executables are no longer included. Symantec does offer a freely downloadable set of compilers that run under DOS here. (This link appears to be broken.)

How do I specify other compiler flags to the IDDE?

    To give 'other' flags (newer ones not on the property pages) such as -Ab, use the 'defines' edit box and give the flags there. In such a case, you must explicitely use -D for your defines. If you are only defining, then -D is not required.

    e.g. If you want to define 'NDEBUG' only, specify only 'NDEBUG'. If in addition, you want to specify -Ab, you must write:

    -Ab -DNDEBUG
    

Redefined type errors when including the socket header files

    There are some name collisions by default when including the socket header files. It reports about 5 redefined variable types, fd_set being among them. fd_set can also be found in types.h and unistd.h.

    The solution is to #define _WIN32_WINNT 0x0400 in order to force windows.h to include winsock2.h, not winsock.h.


I'm getting a message about SCT3D32.DLL not installed

    This can happen when creating an application using the AppExpress feature of ProjectExpress [Project->New] in the IDDE. Clicking "use AppExpress" followed by "finish", the message in a window titled CTL3DV2 appears:
    "This application uses SCT3D32.DLL, which has not been correctly
    installed."
    
    This message is generated by SCT3D32.DLL itself (a Microsoft supplied DLL), and is produced when it is not residing in the system directory. SCT3D32.DLL is in the \dm\bin directory. Copy it to your windows system directory (which on NT is \winnt40\system32), and rename the one in \dm\bin to SCT3D32.DLL.OLD.

    This is the only known DLL with this problem.


How do I work with old CodeView?

    The problem:

    Compiling a test program like this,
    dmc -ms -0 -g -L/co/ma foo.c
    
    and proceeding to load CodeView in "real" DOS produces the message:
    CV0104 Warning:  CodeView information for 'D:\FOO.EXE' is
    newer than this version of CodeView
    
    The version of codeview is 4.01 as supplied in the MASM 6.11 package, dated from 1992. Using /cvversion:4 to the linker produces the same result, as well as using compiler option -g4. Using masm to assemble an example program and linking using Microsoft Link does work with codeview. Linking the same .obj file with optlink/cvversion:4 produces the same failure.

    The solution:

    Optlink runs cvpack when generating cv4 info. This seems to be the cause of the trouble: cv only gives the "info is newer than this version of codeview" error when cvpack is executed without any options. When optlink is given the /nocvpack option, then run cvpack manually with the minimal option, the debugger (cv) then reports with symbolic names. For example:
    dmc -ms -0 -g -L/co/l/i/nocv foo.exe
    cvpack /minimal foo.exe
    
    and cv will work.

    (Thanks to Jack Jay for tracking this down.)


I need an import library for a Windows system DLL


ClassExpress crashes reading resources created by VC++

    The problem is in the .rc file. If the project has numbers (i.e. 63552, 10254, ...) in place of menu resource ID's (i.e. IDM_FILE_OPEN, IDM_FILE_SAVE, ...) then ClassExpress will crash when looking at "Control ID's in Class" under "Message Maps".

    Replace the numbers with the correct resource ID defines from "resource.h".

    (Thanks to Andrew Corkan for tracking this down.)


IDDE sometimes can't find files, shows paths wrong?

    Some parts of the IDDE cannot deal with paths and filenames that have embedded spaces in them, for example if some of the source files are in: \program files\dev\dm (note embedded space between "program" and "files"). The solution is to (1) use paths that don't embed spaces or (2) use the subst command, i.e. subst z: \program files\dev and then refer to the files as being off of z: in the IDDE.

    (Thanks to Chris Widdows and Jan Knepper for tracking this down.)


I need winfax.h or some other new Win SDK header file.

    Windows SDK updates can be downloaded from sdkupdate which includes winfax.h.

Resource Editor crashes under Windows ME?

    When starting RS32 under WinME, it crashes with "Abnormal program termination", and then a page fault in SFC30.DLL. The fix is to install Microsoft's update for Microsoft Explorer MSIE5.5 SP2. This apparently updates some broken system DLLs.

    (Thanks to Laurentiu Pancescu for tracking this down.)


How do I use DirectX with DMC?

    You can get .lib files from MS DIRECTX SDK and convert them to OMF format with coff2omf. Then use the .h files from the same SDK. If using only a limited set of DirectX functions, it is possible to build a .lib from .DLL using the implib utility.

    (Thanks to Nic Tiger.)


Why can't I create a workspace in the IDDE?

    The menu items Environment->Workspace->New or Environment->Workspace->Clone are always grayed in the installation. The limit is 5 workspaces, and as delivered on the CD there are already 5. To create a new workspace, delete one of the existing ones first.

    (Thanks to Frank Albe.)


The IDDE doesn't seem to work with spaces in filenames

    The IDDE cannot handle spaces, + signs, or ~ characters in filenames or path names. It cannot be installed in a directory with such characters in it, for example, it cannot be installed under \Program Files\.

When I run the compiler, it just flashes on the screen and disappears?

The free downloadable compiler is a console program. That means it needs to be run from within a console window. To start a console for Windows XP, click on [Command Prompt] from the [start] menu. The GUI version of the compiler comes with the CD.

What is the sc command?

The sc and dmc commands are identical.

Where is the header file <iostream>?

iostream is part of STLport. It comes on the CD. It is also available as a separate download. (If the \dm\stlport directory is not there, you'll need to download it.) Do one of the following:
  • Add the following switch:
    -I\dm\stlport\stlport
    
    when compiling.
  • Add \dm\stlport\stlport to the INCLUDE environment variable search path before \dm\include.
  • Modify the INCLUDE entry in \dm\bin\sc.ini to be:
    INCLUDE="%@P%\..\stlport\stlport";"%@P%\..\include";"%@P%\..\mfc\include";%INCLUDE%
    
For more information, see \dm\stlport\readme.txt.

I get 'Symbol Undefined _WinMain@16'?

When linking a program as a GUI application, but having a main() like a console application, results in the error message from the linker:
link /NOI /DE /PACKF /XN /NT /ENTRY:WinMainCRTStartup /BAS:4194304 /A:512
@tst.LNK
Error: c:\dm\lib\SNN.lib(winstart)  : Symbol Undefined _WinMain@16
Errors: 1  Warnings: 0
Build failed
If using the IDDE, this is corrected by selecting [Console] under [Target Type] in the first [Tab] of [Project Settings].

If using a module definition (.def) file, these lines should appear in it:

EXETYPE          NT
SUBSYSTEM        CONSOLE
Do not use /ENTRY:WinMainCRTStartup in a command to the linker, this specifies a Windows application.

I am getting an incomprehensible error message when compiling.

The syntax and semantics of C++ can be convoluted, and when the compiler encounters an error, it makes a guess at what might have gone wrong and issues an error message. If the construct being compiled is the result of layers of macros, template expansions, typedefs, etc., it can sometimes not be at all clear what is going wrong. When all else fails, here are some techniques for isolating down what the problem is. At each step, verify that the error message continues to be generated.
  1. Redirect the output of the makefile to a .bat file:
    make -ffoo.mak >cc.bat
    
  2. Edit cc.bat so it is just compiling the source file that fails.
  3. Rename the source file that fails to test.cpp, and edit cc.bat so it is compiling test.cpp.
  4. Remove any precompiled header switches from cc.bat.
  5. Ruthlessly hack off chunks of test.cpp until the smallest source file remains that still shows the error.
  6. Many projects #include a complicated, confusing mass header files from multiple locations. These header files will also be commonly filled with macros and #if's, making it really hard to be sure what is going on in them. Add the -e and -l switches to cc.bat, which will produce a file called test.lst. This file will have all the #include files included, and all macros will be expanded, and all false conditional code will be removed. Rename test.lst to test.cpp, and continue hacking and slashing off all the code that does not contribute to the error message.
Experience shows nearly all such problems can be thusly reduced to maybe 10 lines of code or less. These 10 lines of code usually make it obvious what is going wrong, and what a suitable fix or workaround could be. Failing that, the code can be posted to the Digital Mars news groups where many people can help. (Far more people are willing to help when the problem is shortened like this, few will offer to help if it somewhere in a megabyte of source.) If the result appears to be a problem with the compiler, see bug reports.

How do I stop the console window from appearing?

Add these lines to the module definition file (.def):
EXETYPE       NT
SUBSYSTEM     WINDOWS
or add the linker flag -L/exet:nt/su:windows.

A strange extra line is displayed under the menu bar?

This occurs on Windows XP systems running in the standard XP style UI. It does not occur on Win 2K, or XP in "classic" mode. The solution is to make sure the following lines are in the module definition file:
EXETYPE NT
SUBSYSTEM WINDOWS,4.0
or add the linker flag -L/exet:nt/su:windows:4.0.