Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. error C2039: 'abort' : is not a member of 'std'

error C2039: 'abort' : is not a member of 'std'

Scheduled Pinned Locked Moved ATL / WTL / STL
helpquestionannouncement
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KASR1
    wrote on last edited by
    #1

    In VC6 when I use

    std::abort();

    I am geting an error "error C2039: 'abort' : is not a member of 'std'". But it compiles well in VS2010. I am seeing the definition of abort in both version of stdlib.h. What is the problem?

    L S 2 Replies Last reply
    0
    • K KASR1

      In VC6 when I use

      std::abort();

      I am geting an error "error C2039: 'abort' : is not a member of 'std'". But it compiles well in VS2010. I am seeing the definition of abort in both version of stdlib.h. What is the problem?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The problem is that stdlib.h does not define the std namespace, it is the standard C library header. You should include cstdlib for use of the std namespace features.

      One of these days I'm going to think of a really clever signature.

      K 1 Reply Last reply
      0
      • L Lost User

        The problem is that stdlib.h does not define the std namespace, it is the standard C library header. You should include cstdlib for use of the std namespace features.

        One of these days I'm going to think of a really clever signature.

        K Offline
        K Offline
        KASR1
        wrote on last edited by
        #3

        Even after including cstdlib, I am seeing the same error.

        L 1 Reply Last reply
        0
        • K KASR1

          Even after including cstdlib, I am seeing the same error.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Difficult to guess without more information; take a look at the header file to see how it is declared.

          One of these days I'm going to think of a really clever signature.

          1 Reply Last reply
          0
          • K KASR1

            In VC6 when I use

            std::abort();

            I am geting an error "error C2039: 'abort' : is not a member of 'std'". But it compiles well in VS2010. I am seeing the definition of abort in both version of stdlib.h. What is the problem?

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            Throw VC6 in the bin, it's long past its useby date.

            Steve

            K 1 Reply Last reply
            0
            • S Stephen Hewitt

              Throw VC6 in the bin, it's long past its useby date.

              Steve

              K Offline
              K Offline
              KASR1
              wrote on last edited by
              #6

              Thanks. Yes, That's right! we are slowly moving to VS2010. But at this point of time we are in a situation to use

              std::abort();

              in both VC6 and VS2010. This compiles well in VS2010 but my concern is why its not in VC6. Any idea would be helpful.

              L 1 Reply Last reply
              0
              • K KASR1

                Thanks. Yes, That's right! we are slowly moving to VS2010. But at this point of time we are in a situation to use

                std::abort();

                in both VC6 and VS2010. This compiles well in VS2010 but my concern is why its not in VC6. Any idea would be helpful.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Why not just use abort()? Adding the namespace prefix buys you nothing.

                One of these days I'm going to think of a really clever signature.

                K 1 Reply Last reply
                0
                • L Lost User

                  Why not just use abort()? Adding the namespace prefix buys you nothing.

                  One of these days I'm going to think of a really clever signature.

                  K Offline
                  K Offline
                  KASR1
                  wrote on last edited by
                  #8

                  Ok. Sorry for not explaining that the code piece 'std::abort()' is part of third party and we cannot modify it.

                  L 1 Reply Last reply
                  0
                  • K KASR1

                    Ok. Sorry for not explaining that the code piece 'std::abort()' is part of third party and we cannot modify it.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Then contact the third party and tell them to fix it. I assume that you have paid for this code in which case it is their responsibility to provide a fully working solution. With the amount of information you have provided about this code it is difficult to make any better suggestions.

                    One of these days I'm going to think of a really clever signature.

                    K 1 Reply Last reply
                    0
                    • L Lost User

                      Then contact the third party and tell them to fix it. I assume that you have paid for this code in which case it is their responsibility to provide a fully working solution. With the amount of information you have provided about this code it is difficult to make any better suggestions.

                      One of these days I'm going to think of a really clever signature.

                      K Offline
                      K Offline
                      KASR1
                      wrote on last edited by
                      #10

                      Thanks for your help. I found a soultion to this problem.

                      #if _MSC_VER <=1200
                      namespace std
                      {
                      using ::abort;
                      }
                      #endif

                      This way we can make 'std' namespace to refer global abort(). It doesn't require to modify 3rd party.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups