I feel very foolish asking this question, but please bear with me and read the symptoms before commenting "it's main()
, duh".
I'm working on a project in Visual Studio Express 2012. We have hitherto built only for the Win32 (x86) platform but I am converting the .exe build to 64 bit. I now have a fully linked .exe, but a funny thing happened along the way: the entry-point no longer gets called.
The entry-point to the (C++, console) program is a C++ function declared at file scope with the following signature: int main(int argc, char * argv[])
. This function has happily worked in the x86 executable since day 1. It is not being called on x64:
main
like int * p(nullptr); *p = 5;
, the program doesn't crash (even without this I'm certain main()
isn't running).What could be causing this issue? How can I debug it? I'm not sure where to set a breakpoint in my debuggers due to the fact that none of my code ever runs...
0xc000007b
is STATUS_INVALID_IMAGE_FORMAT
. That is, the operating system never even gets the binary loaded far enough to start executing it.
There could be something wrong in your compilation settings. However, usually when I have seen this error, the problem has been in the 64-bit application trying to dynamically link to a 32-bit DLL.
Check your libraries, and verify your paths point to the 64-bit versions of any DLLs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With