dmc (digital mars compiler)

This is a discussion on dmc (digital mars compiler) within the C++ Programming forums, part of the General Programming Boards category; Does anybody use dmc for c++? I have been using it for several years, ever since I started programming with ...

  1. #1
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    435

    dmc (digital mars compiler)

    Does anybody use dmc for c++? I have been using it for several years, ever since I started programming with regular C and it has worked great. DMC claims to support c++ but I just started learning c++ today and trying some things out and I am running into some problems.

    Code:
    #include <iostream>
    gives an error.
    Code:
    #include <iostream.h>
    This works. It's kind of annoying, but I'm willing to live with that.

    Code:
    using namespace std;
    Error: undefined identifier 'std'

    using the -A (conformity to standard C/C++) switch fixes this for some reason, I don't know why.

    Code:
    std::string my_string;
    Error: 'string' is not a member of namespace 'std'

    If I am doing something wrong (I have installed stlport and I use the -cpp switch although it automatically compiles in cpp mode if the filename extension is .cpp or .c++), or if there is an easy way to fix this I would like to know. Otherwise can anybody recommend a good command line C++ compiler for windows?

    Thanks
    -nb

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    903
    You need to include <string>. Not that neither <cstring> or <string.h> are valid replacements for <string> if it cannot be found by your compiler. They are C stuff, not the C++ std::string.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,702
    I would start looking into the version of the compiler and libraries you are using - and see if there are any upgrades available.

    gg

  4. #4
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    435
    Thanks guys. I fixed it. DMC, despite having full c++ support requires you to download the STL libraries, which I did but apparently screwed something up the first time.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I have no experience with the DMC compiler, but I would say that either a gcc-based compiler & environment [e.g. gcc-mingw, Dev-cpp, Code::Blocks] or a Microsoft Visual Studio setup would be a better choice. The gcc compilers are REALLY good with usually good warnings and compliance to the relevant standards, Visual studio has a REALLY GOOD integrated editor, debugger and other tools - it's VERY slick.

    Both products are widely used by members here.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    435
    Thanks mats. I already have Visual C++ (the free one) installed, but I don't use it because I don't want to have to deal with "projects" for every 30 line test program that I run. C++ in dmc has been working very well for me since I fixed it, but if it is possible to compile in command line without creating a project, I would still consider using VC.

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You can use Visual Studios compiler for command line compiles - no problem at all. You'll need to set the path to the correct directory for "cl.exe" [there's a "vcvars32.bat" that will do all the necessary setup for that, or you can copy the actions of vcvars32.bat into your system environment if you like].

    That's one of the methods I use for "small test apps" - the other one is to have a "scratch" project, where I just replace the content of the single file in the project.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,033
    Quote Originally Posted by matsp View Post
    That's one of the methods I use for "small test apps" - the other one is to have a "scratch" project, where I just replace the content of the single file in the project.

    --
    Mats
    I tend to do the same as matsp.
    Create one project and just replace the contents with something else when you want to mess with it (or just comment out the old stuff and add new).
    I do really recommend Visual Studio since it's just not a compiler, but an IDE and a debugger too (and it's slicker than dev-cpp to boot).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 12:07 PM
  2. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  3. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  4. Help With finding a compiler
    By macman in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-15-2005, 09:15 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 10:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21