Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   error C2039: 'Esp' : is not a member of '_CONTEXT' (http://www.go4expert.com/forums/error-c2039-esp-context-t19209/)

vikaschandra 28Aug2009 15:54

error C2039: 'Esp' : is not a member of '_CONTEXT'
 
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.

xpi0t0s 31Aug2009 14:44

Re: error C2039: 'Esp' : is not a member of '_CONTEXT'
 
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.

vikaschandra 1Sep2009 14:00

Re: error C2039: 'Esp' : is not a member of '_CONTEXT'
 
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.

naimish 1Sep2009 14:31

Re: error C2039: 'Esp' : is not a member of '_CONTEXT'
 
What was the error ?

xpi0t0s 1Sep2009 14:34

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

Originally Posted by naimish (Post 56595)
What was the error ?

The error was "error C2039: 'Esp' : is not a member of '_CONTEXT'".


All times are GMT +5.5. The time now is 12:08.