Menu

Compiling with Visual C++ 5

Help
Anonymous
2000-05-10
2000-05-10
  • Anonymous

    Anonymous - 2000-05-10

    Hello,

    I had some problems compiling the 1.0.0 release (The ZIP-File).
    The standard C++ definitions are all in the std-namespace, but
    your sources don't seem to take care of it. For example you use
    string without the std:: prepended.

    I could fix the problems by inserting std:: into the headers
    where needed and using a "using namespace std" in the sources.

    Another error occured due to the includes of <iostream.h> instead of
    <iostream> (There are more *stream headers used this way). Using
    the right version of the headers (<*stream> instead of <*stream.h>)
    fixes this (Because Visual C++ has two stream libraries. An old with
    <*.h> headers and the more standard conformant with <*> headers).

    I took a look into the C++ standard and all the above fixes are
    conformant to it. Will the source get changed this way or is the
    current namespace/include behaviour going to be kept due to other
    build environments not beeing standard conformant. (At least GCC 2.95
    compiles the code with std-namespaces and the new include file names)

    Some more questions:

    - Your library uses exceptions that only have a GetMessage method.
      Isn't it better to derive the exception classes from std::exception
      and use it's what() method instead of GetMessage. This makes it more
      comfortable in catch clauses since you only have to write

      catch(std::exception&Ex)

      where you want to do so.

     
    • David Sugar

      David Sugar - 2000-05-10

      Appearently there is some problems with newer windows iostream library, or so I have been told, and that the runtime libraries for building stream handlers using the <iostream> header does not work while the older library and <iostream.h> header does.  Rather odd, but since most systems do not have multiple runtime libraries it seemed harmless enough to use <iostream.h> which usually just has a "#include <iostream>"

      While gcc 2.95 does indeed compile fully standard C++ code, many older C compilers do not and many free operating systems are still distributed with older gcc compilers (freebsd particularly comes to mind in this regard).

      At some point fully conforming C++ compilers will become the "norm" rather than the exception, and at that point namespaces will be used properly and completely in Common C++.  I now suspect this decision is going to be much sooner than later, perhaps even by the next "important" release point (1.1).  As for the issues related to Visual C++ and windows specifically, I am looking for someone who would be willing to join the Common C++ project on a more permenant basis to help maintain the win32 code base properly.  I do not activily use windows (or Visual C++) at all at present, and currently maintain the tree using a GNU/Linux hosted gcc (2.8.1) cross compiler tool-chain I built up from the mingw32 support.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.