1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

error C2039: 'Esp' : is not a member of '_CONTEXT'

Discussion in 'C' started by vikaschandra, Aug 28, 2009.

  1. vikaschandra

    vikaschandra New Member

    Joined:
    Aug 28, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I m getting this error when compiling for 64-bit.
    The code works fine for 32 bit compilation.
    I am using visual studio 2005 professional edition on windows XP 64 bit.
    Can anyone help me out?

    Thanks.
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    What are you compiling?
    What line of code throws the error?

    The error means that you are using a structure named _CONTEXT (maybe you have a variable of that type) and attempting to use a member named Esp, but that member doesn't exist. If the build works fine in 32-bit then I'd say _CONTEXT is defined differently for 32-bit and 64-bit, and to fix this error you need to determine why you're using Esp and what different member of _CONTEXT you should use to accomplish the same goal.
     
  3. vikaschandra

    vikaschandra New Member

    Joined:
    Aug 28, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I got the solution.
    Problem was with register.
    "Esp" register is not available for 64 bit,so it was not identifying that.
    Using "Rsp" instead of "Esp" fixed the problem.

    Thanks.
     
  4. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,046
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    What was the error ?
     
  5. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    The error was "error C2039: 'Esp' : is not a member of '_CONTEXT'".
     

Share This Page