×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    9

    Compile-time error when using 'std::nothrow'

    Hi,

    I have been experimenting with OpenC/C++. When using 'std::nothrow' for a simple construct as below:
    Code:
    int *my_num = new (std::nothrow) int;
    It compiled without errors for the WINSCW target, however, for the GCCE target it gave the following error:
    undefined reference to `std::GetNoThrowObj()'
    It appears to be connected to 'libstdcpp.lib' for when this was removed from the MMP, a similar error was shown even for the WINSCW compile.

    I am using Carbide C++ Version 2.0, and have followed the OpenC/C++ docs when creating the MMP file

    Code:
    SYSTEMINCLUDE     \epoc32\include\stdapis
    SYSTEMINCLUDE     \epoc32\include\stdapis\sys
    SYSTEMINCLUDE     \epoc32\include\stdapis\stlport
    
    LIBRARY           libstdcpp.lib
    LIBRARY           libc.lib
    LIBRARY           euser.lib
    
    OPTION CW -wchar_t on 
    MACRO  _WCHAR_T_DECLARED
    If anyone's come across this, or if I'm missing something, please do let me know.

    Thanks,
    Pac.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Compile-time error when using 'std::nothrow'

    Hi,

    It may well be that it isn't supported at the moment. However, in the current version of Open C I think you'll find that the new doesn't throw anyway since Symbian's global operator new doesn't and the overload called with new (ELeave) leaves instead.

    Mark

    EDIT: Sorry, saw your other post in the other thread after this... you already knew about new not throwing. Yes, the overloaded operator new with a dummy parameter does work (as in new (ELeave)).
    Last edited by Sorcery-ltd; 2009-03-18 at 16:04.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    9

    Re: Compile-time error when using 'std::nothrow'

    Hi,

    Thanks for the reply.

    I was looking to write some engine code with cross platform portability in mind. std::nothrow would have helped future-proof the code for Symbian, if at all the support for throwing bad:alloc is added in later versions, and would have maintained consistency across platforms, but alas ....

    Thanks,
    Pac.

Similar Threads

  1. How to shorten transfert time?
    By Slump in forum Bluetooth Technology
    Replies: 3
    Last Post: 2009-03-23, 12:06
  2. Replies: 0
    Last Post: 2008-01-03, 17:58
  3. Problem in Time
    By aamitgupta in forum Symbian
    Replies: 7
    Last Post: 2007-12-21, 16:18
  4. Time Machine for Symbian Series 60
    By kedarchitale in forum Symbian
    Replies: 2
    Last Post: 2006-03-30, 20:44
  5. Bizarre calendar/time zone change handling in Nokia 9500
    By noetus in forum General Development Questions
    Replies: 0
    Last Post: 2005-09-19, 19:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×