I'd also like to add that if Seth sends me the .exe i can run it fine. But if I compile it on my own, i receive the aforementioned error.
Access violation writing location 0x764f3398
What are the differences in bitness (32 vs. 64) between your and your friends system?
Are you exchanging the source only or the solution/vcproj files as well?
If only the first, make sure you have the same settings. That's what L.Spiro was on about, the project settings do not seem to match.
Just as a side note but there is no pointer cast anywhere in that code, UINT_PTR is not a pointer it is just a unsigned integer type to hold a pointer address.
I meant the union, you are implicitly assuming the FT structure is exactly as large as an unsigned __int64 when using this union - which is what MSDN is essentially warning against - but Spiro's theory seems more plausible.Just as a side note but there is no pointer cast anywhere in that code, UINT_PTR is not a pointer it is just a unsigned integer type to hold a pointer address.
I meant the union, you are implicitly assuming the FT structure is exactly as large as an unsigned __int64 when using this union - which is what MSDN is essentially warning against - but Spiro's theory seems more plausible.Just as a side note but there is no pointer cast anywhere in that code, UINT_PTR is not a pointer it is just a unsigned integer type to hold a pointer address.
Both machines are 64 bit. I also tested the code on a 32 bit windows and it worked fine. The code also compiled without problems on mac.
What are the differences in bitness (32 vs. 64) between your and your friends system?
Are you exchanging the source only or the solution/vcproj files as well?
If only the first, make sure you have the same settings. That's what L.Spiro was on about, the project settings do not seem to match.
He sent me solution and everything, but as a test I create a new project copy and pasted the source into new files. Then linked the correct files. Still no luck. I have also tried compiling on a netbook and a virtual machine with a different OS with absolutely 0 luck.
HOLY CRAP I GOT IT. For some reason linking libglu32.a was causing the problems!
10+ hours of troubleshooting and it was that simple!
Just a note but this is Microsoft's code (if the header didn't give it away) that forms part of the CRT (C runtime). This particular feature is a fairly basic mechanism for attempting to detect buffer overflows that have written over the return value on the stack. By placing a cookie before the return address and then comparing a saved cookie with the global copy before returning, the runtime can tell whether the return address may have been modified by an overflow, either accidentally or maliciously.
If you want disable it, just make sure the /GS switch isn't set. I'd advise against this though as it's most likely that the problem is in your own code or that of some library you're using, not the runtime's.
Either posting a copy of the faulty executable or better still, the source, would be helpful.
Edit: Site went down during posting, not having much luck tonight. Glad to hear you've got it sorted one way or another.