Issue
I have set path to the gcc
inside the dev-c
. It compiles fine and creates the executable but it fails to run the program and shows a message box (as shown in the first picture) first and then prints the error message on the console
NOTE:
- The program completely works fine producing the output if I run the program using the
Dev-Cpp
on my system, but when I invoke the compiler using the command prompt I get these mentioned issues. - I am using Windows XP.
- I also have msys installed
Updates (from Comments)
I know that dependancy walker
says I have dependancy issues, but if that is the case then how does Dev-CPP compile the program on my computer ? As said before Dev-Cpp
is able to compile and run the code that is written on to its editor. My best guess is that gcc detects my 32 bit operating system and adds some switch to Dev-Cpp
compiltation process like
gcc -something -something my_program.c
can some one find what that something
is ?
Solution
If you look carefully at the CPU column in the depends display, you'll see that your program has been compiled as an x64 binary. It looks like your system doesn't have a 64-bit version of Windows installed.
So apparently your gcc is configured to produce x64 binaries by default. Use the -m32
option to get it to produce a 32-bit x86 binary.
Answered By - Michael Burr