C++ compiler for STL *and* exceptions - OS2

This is a discussion on C++ compiler for STL *and* exceptions - OS2 ; Hi, is there a C++ compiler available whichs supports reasonable recent STL versions (basically namespaces, member templates and template statics) and exceptions together. All newer gcc builts from Innotek fulfill the first requirement very well, but crash all my applications ...

+ Reply to Thread
Results 1 to 19 of 19

Thread: C++ compiler for STL *and* exceptions

  1. C++ compiler for STL *and* exceptions

    Hi,

    is there a C++ compiler available whichs supports reasonable recent STL
    versions (basically namespaces, member templates and template statics)
    and exceptions together.

    All newer gcc builts from Innotek fulfill the first requirement very
    well, but crash all my applications on nerly all exceptions. Older emx
    versions have serious problems with templates.


    I don't know about the features of Watcom C++. The last version I know
    is 10.0, which did not suppot much of C++. This applies to VAC 3.08 too.


    Marcel

  2. Re: C++ compiler for STL *and* exceptions

    On Tue, 16 Nov 2004 17:16:22 +0100, Marcel M ller wrote:

    :>Hi,
    :>
    :>is there a C++ compiler available whichs supports reasonable recent STL
    :>versions (basically namespaces, member templates and template statics)
    :>and exceptions together.
    :>
    :>All newer gcc builts from Innotek fulfill the first requirement very
    :>well, but crash all my applications on nerly all exceptions. Older emx
    :>versions have serious problems with templates.
    :>
    :>
    :>I don't know about the features of Watcom C++. The last version I know
    :>is 10.0, which did not suppot much of C++. This applies to VAC 3.08 too.

    Watcom is now open source (www.openwatcom.org), and is slowly improving in
    the C++ arena. Best ask that question in the C/C++ users groups at
    news.openwatcom.org. Another reference you might find handy is
    http://cmeerw.org/prog/freecpp/ , which lists Win32 compilers but Watcom is
    of course pretty much platform independent.

    Mat Nieuwenhoven



  3. Re: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:
    >
    > Hi,
    >
    > is there a C++ compiler available whichs supports reasonable recent STL
    > versions (basically namespaces, member templates and template statics)
    > and exceptions together.
    >
    > All newer gcc builts from Innotek fulfill the first requirement very
    > well, but crash all my applications on nerly all exceptions.


    I don't know, but maybe you need some switch on the compiler command
    line. Try and check this out.

    Or you could use emx+pgcc (2.95.2). I'm forced to stick with this and
    I'm not that happy, because it's got some more bugs and some feature
    missing, compared to 3.x; However I use STL, templates, exceptions,
    namespaces, etc. with very few restrictions.

    bye
    av.

  4. Re: C++ compiler for STL *and* exceptions

    Andrea Venturoli wrote:

    >>All newer gcc builts from Innotek fulfill the first requirement very
    >>well, but crash all my applications on nerly all exceptions.

    >
    > I don't know, but maybe you need some switch on the compiler command
    > line. Try and check this out.


    I have no idea what kind of switches I should try. Unfortunately, there
    is no debugger support except of VAC 4. So I am very handicaped when
    tracking down the problem.
    Maybe it is not directly related to the exceptions, but to some heap
    corruption. Without a debug heap it is nearly impossible to find this
    out, because I can only overload/control the global new/delete operators
    and my own malloc/free calls but not the allocations through the runtime.

    > Or you could use emx+pgcc (2.95.2). I'm forced to stick with this and
    > I'm not that happy, because it's got some more bugs and some feature
    > missing, compared to 3.x; However I use STL, templates, exceptions,
    > namespaces, etc. with very few restrictions.


    As far as I know the namespace support of 2.95.2 ends at the point that
    it does not report an error about the keyword. Furthermore I always had
    problems with smart pointers (beyond auto_ptr). And without them C++ is
    a pain. But exceptions always worked fine.


    Marcel

  5. Re: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:

    > I have no idea what kind of switches I should try. Unfortunately, there
    > is no debugger support except of VAC 4. So I am very handicaped when
    > tracking down the problem.


    The missing debugger is THE reason I got stuck to 2.95.2.



    > As far as I know the namespace support of 2.95.2 ends at the point that
    > it does not report an error about the keyword.


    I'm not sure, but I think that was 2.8.



    > Furthermore I always had
    > problems with smart pointers (beyond auto_ptr).


    I'm using std::auto_ptr and boost::shared_ptr: they both work
    flawlessly!

    bye
    av.

  6. Re: C++ compiler for STL *and* exceptions

    On Wed, 17 Nov 2004 17:59:03 UTC, Andrea Venturoli wrote:

    > Marcel Müller wrote:
    >
    > > I have no idea what kind of switches I should try. Unfortunately, there
    > > is no debugger support except of VAC 4. So I am very handicaped when
    > > tracking down the problem.

    >
    > The missing debugger is THE reason I got stuck to 2.95.2.


    I have ICSDebug of VAC++ 3.08 working here with gcc 3.2.2, but I agree
    that it is not perfect. At least it can see the symbols in debug
    executables which the VAC 4.0 version could not. A working gdb version
    for gcc 3.2.2 would be really nice!
    --
    Greetings, Please reply in newsgroup, I rarely
    Peter. read emails to pweilba@gwdg.de...

  7. Re: C++ compiler for STL *and* exceptions

    Hi

    I tried the free stl with VA 308 but to get the string things to work
    one first have to do some intermediate leg work and compile it which I
    never got to work, but if one could this would be a great solution


    adrian

  8. Re: C++ compiler for STL *and* exceptions

    On 17 Nov 2004 22:43:33 GMT, Peter Weilbacher wrote:

    :>On Wed, 17 Nov 2004 17:59:03 UTC, Andrea Venturoli wrote:
    :>
    :>> Marcel Müller wrote:
    :>>
    :>> > I have no idea what kind of switches I should try. Unfortunately, there
    :>> > is no debugger support except of VAC 4. So I am very handicaped when
    :>> > tracking down the problem.
    :>>
    :>> The missing debugger is THE reason I got stuck to 2.95.2.
    :>
    :>I have ICSDebug of VAC++ 3.08 working here with gcc 3.2.2, but I agree
    :>that it is not perfect. At least it can see the symbols in debug
    :>executables which the VAC 4.0 version could not. A working gdb version
    :>for gcc 3.2.2 would be really nice!

    The OpenWatcom development version seems to have a (Linux) debugger which is
    quite usable debugging gcc produced programs. I have not heard of anyone
    trying it with gcc OS/2 programs, but it is worth a shot IMHO.

    Mat Nieuwenhoven



  9. Re: C++ compiler for STL *and* exceptions

    Mat Nieuwenhoven wrote:

    > The OpenWatcom development version seems to have a (Linux) debugger which is
    > quite usable debugging gcc produced programs. I have not heard of anyone
    > trying it with gcc OS/2 programs, but it is worth a shot IMHO.
    >

    Unless that version of gcc is producing DWARF debug information
    (which I don't think it does), it's definitely not gonna work!


    Michal


  10. Re: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:

    > Hi,
    >
    > is there a C++ compiler available whichs supports reasonable recent
    > STL versions (basically namespaces, member templates and template
    > statics) and exceptions together.
    >
    > All newer gcc builts from Innotek fulfill the first requirement very
    > well, but crash all my applications on nerly all exceptions. Older emx
    > versions have serious problems with templates.



    Don't know if you are aware, but there is a new version of gcc (3.3.5)
    available at Netlabs. It's only a test release but has numerous
    enhancements.


    Might be worth trying...


    > Marcel



  11. Re: C++ compiler for STL *and* exceptions

    jp wrote:

    > Don't know if you are aware, but there is a new version of gcc (3.3.5)
    > available at Netlabs. It's only a test release but has numerous
    > enhancements.


    Oh took me a while until I searched at the ftp server directly.
    I will give it a try and report wether I am successful.


    Marcel

  12. Re: C++ compiler for STL *and* exceptions

    jp wrote:
    >
    > Marcel Müller wrote:
    >
    > > Hi,
    > >
    > > is there a C++ compiler available whichs supports reasonable recent
    > > STL versions (basically namespaces, member templates and template
    > > statics) and exceptions together.
    > >
    > > All newer gcc builts from Innotek fulfill the first requirement very
    > > well, but crash all my applications on nerly all exceptions. Older emx
    > > versions have serious problems with templates.

    >
    > Don't know if you are aware, but there is a new version of gcc (3.3.5)
    > available at Netlabs. It's only a test release but has numerous
    > enhancements.
    >
    > Might be worth trying...


    Does it include a reasonably recent gdb?

    bye & Thanks
    av.

  13. Re: C++ compiler for STL *and* exceptions

    jp wrote:
    > Don't know if you are aware, but there is a new version of gcc (3.3.5)
    > available at Netlabs. It's only a test release but has numerous
    > enhancements.


    gcc 3.3.5 did the job!
    The application (with exceptions) is now working as far as I can see.

    Unfortunately it will time bomb in aproximately 6 weeks, as well as
    earlier versions did, too.


    Once the gdb problem is fixed, we are mostly state of the art concerning
    C++.


    Marcel

  14. Re: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:

    > jp wrote:
    >
    >> Don't know if you are aware, but there is a new version of gcc
    >> (3.3.5) available at Netlabs. It's only a test release but has
    >> numerous enhancements.

    >
    >
    > gcc 3.3.5 did the job!
    > The application (with exceptions) is now working as far as I can see.
    >


    Excellent!

    Be sure to let the developer know that it has allowed you to do
    something you couldn't do before. IMV, the next release of gcc on OS/2
    will be one of the most sigificant developments for OS/2 for a long time.



    > Unfortunately it will time bomb in aproximately 6 weeks, as well as
    > earlier versions did, too.
    >

    Well it is very much a alpha version and is undergoing considerable
    development just now. Just make sure you can rebuild your app again as
    soon as the next release comes out.

    Can you remind me what it is, BTW?

    >
    > Once the gdb problem is fixed, we are mostly state of the art
    > concerning C++.
    >
    >
    > Marcel



  15. Re: C++ compiler for STL *and* exceptions

    jp wrote:
    > Marcel Müller wrote:
    >> gcc 3.3.5 did the job!
    >> The application (with exceptions) is now working as far as I can see.

    >
    > Excellent!
    >
    > Be sure to let the developer know that it has allowed you to do
    > something you couldn't do before. IMV, the next release of gcc on OS/2
    > will be one of the most sigificant developments for OS/2 for a long time.


    Who is /the/ developer?


    >> Unfortunately it will time bomb in aproximately 6 weeks, as well as
    >> earlier versions did, too.
    >>

    > Well it is very much a alpha version and is undergoing considerable
    > development just now. Just make sure you can rebuild your app again as
    > soon as the next release comes out.


    Yes, I know. I will not be able to distribute binaries so far, but this
    is no major problem for the moment.

    > Can you remind me what it is, BTW?


    It is currently a more sophisticated EXIF 2.2 reader, intended to
    superceed renamapics, which only extracts very partial information from
    my Dimage pictures.
    But other apps were affected by the same problem too. E.g. a generic
    stream processing library, which do I use to do filtering of audio data
    or the psychoaccustic model of replaygain and so on - mostly on the fly.


    Marcel

  16. Re: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:

    > jp wrote:
    >
    > Yes, I know. I will not be able to distribute binaries so far, but
    > this is no major problem for the moment.
    >
    >> Can you remind me what it is, BTW?

    >
    >
    > It is currently a more sophisticated EXIF 2.2 reader, intended to
    > superceed renamapics, which only extracts very partial information
    > from my Dimage pictures.
    > But other apps were affected by the same problem too. E.g. a generic
    > stream processing library, which do I use to do filtering of audio
    > data or the psychoaccustic model of replaygain and so on - mostly on
    > the fly.
    >

    If any of this is open source software which you want to get working on
    OS/2 you may well be intersted in the os2-unix mailing list. There's
    quite a focus on getting the next gcc to be as standards compliant as
    possible so that it minimises the required input from any porter. The
    eventual aim is to have most open source software buildable on OS/2
    straight out of the box.

    >
    > Marcel



  17. Re: C++ compiler for STL *and* exceptions

    jp wrote:

    > Marcel Müller wrote:
    >
    > If any of this is open source software which you want to get working on
    > OS/2 you may well be intersted in the os2-unix mailing list.


    The other way around. I've written it by myself and it may become open
    source in the future.


    Marcel

  18. Still unsolved: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:

    > jp wrote:
    >> Don't know if you are aware, but there is a new version of gcc (3.3.5)
    >> available at Netlabs. It's only a test release but has numerous
    >> enhancements.

    >
    > gcc 3.3.5 did the job!
    > The application (with exceptions) is now working as far as I can see.


    Don't count your chickens before they are hatched.

    It happend to work only once! (with the alpha release)


    The following example causes the application to terminate unexpectedly:

    test.cpp:
    ----------
    #include

    using namespace std;

    int main()
    { try
    { cout << "before throw" << endl;
    throw 7;
    } catch (...)
    { cout << "exception caught" << endl;
    }
    }
    ----------

    output:
    ----------
    D:\C\Sonstig\EXIF>gcc test.cpp -lstdc++

    D:\C\Sonstig\EXIF>test.exe
    before throw

    Abnormal program termination - pid=0x0ff1 - tid=0x01 -
    D:\C\SONSTIG\EXIF\TEST.EXE

    D:\C\Sonstig\EXIF>gcc --version
    gcc.exe (GCC) 3.3.5 (Innotek Build 2004-11-24 01:02)
    Copyright (C) 2003 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    D:\C\Sonstig\EXIF>emxrev
    EMX : revision = 61
    EMXIO : revision = 60
    EMXLIBC : revision = 63
    EMXLIBCM : revision = 64
    EMXLIBCS : revision = 64
    EMXWRAP : revision = 60

    D:\C\Sonstig\EXIF>
    ----------


    I can't believe it! That's completely unusable.

    Can anyone confirm (or confute) this?

    Maybe there is something else wrong.


    [some later]
    The executables mostly contain references to libc06a3. (Sometimes they
    do not!) Something with __Unwind_DeleteException and so on. Obviously
    ths causes the crash.
    These references are originated by libgcc_so_d.a. I think there is
    something wrong in the build environment of gcc.
    The alpha release still works fine (but only a few days left).


    Marcel

  19. Re: Still unsolved: C++ compiler for STL *and* exceptions

    Marcel Müller wrote:

    >> The application (with exceptions) is now working as far as I can see.

    >
    > Don't count your chickens before they are hatched.
    >
    > It happend to work only once! (with the alpha release)


    I have not used the later versions of gcc on OS/2 for a while,
    but back in October 2003 there was an issue, and I am not aware
    that this has been fixed. I wrote a post to the innotek gcc
    suppoort forums [1] (registration required):

    | posted 22 October, 2003 14:10 @
    | With the current gcc 3.2.2 beta version (beta 3), c++ exceptions
    | still don't fully work.
    |
    | Whenever I have an exception thrown in a function / method I
    | cannot catch it if the throwing routine is implemented in a
    | different source file, regardless of whether or not I use the
    | `-fexception' switch. If both, `throw' and `catch' statements
    | are in the same source everything is fine.
    |
    | Cheers,
    |
    | H.

    The reply was something like "there seems to be problem,
    we will address it. Last time I tested it was sometime early
    this year, and the problem was not fixed then.

    To answer your original question: I am currently using OpenWatcom
    for my C++ development. It has some weaknesses in supporting
    the recent C++ standard, but with a little tweaking it works
    well.

    As an STL I use STLPort, with the diff I provide under [2], and
    the environment variables set by a batch like this:


    | @ECHO OFF
    |
    | if "%WATCOM%" == "" SET WATCOM=D:\Software\Watcom
    | set STLPATH=%WATCOM%\stlport
    |
    | SET PATH=%WATCOM%\BINP;%WATCOM%\BINW;%PATH%
    | SET INCLUDE=%STLPATH%;%WATCOM%\H;%WATCOM%\H\OS2
    | SET FINCLUDE=%WATCOM%\SRC\FORTRAN
    | SET EDPATH=%WATCOM%\EDDAT
    | SET HELP=%WATCOM%\BINP\HELP;%HELP%
    | SET BOOKSHELF=%WATCOM%\BINP\HELP;%BOOKSHELF%
    | SET BEGINLIBPATH=%WATCOM%\BINP\DLL

    (assuming that stlport is installed as a subdirectory to the
    watcom installation dir).

    The limitation is that `using namespace std' will not work with
    OptnWatcom. But exceptions and the STL stuff works beautifully.
    And it's a well-optimizing compiler :-)

    Cheers,

    M.

    [1] http://ubb.innotek.de/ultimatebb.php...;f=33;t=000005
    [2] http://www.fh-wedel.de/pub/fh-wedel/...atcom-os2.diff

    --
    Wer bist du, ungezaehltes Frauenzimmer? Du bist - bist du? - Die Leute sagen,
    du waerest - lass sie sagen, sie wissen nicht, wie der Kirchturm steht.
    -=-=- -=-=-=-=-
    Dipl.Ing. Martin "Herbert" Dietze -=-=- University of Buckingham -=-=-

+ Reply to Thread