Hi, I am using gcc compiler to compile the program and build an exe

I used this command to compile

gcc program.cpp -g -o program (generates program.exe and runs fine)

But, if i write the same thing in system("gcc program.cpp -g -o program"); programmatically, then the exe is generated but, while running it I get a prompt saying "the exe is not compatible...... make see whether you need 32 bit or 62 bit"
I'm using dev c++ for the program! any solutions??

"the exe is not compatible...... make see whether you need 32 bit or 62 bit"

Are you paraphrasing, or is that the exact message? Also, how are you running the generated executable?

Are you paraphrasing, or is that the exact message? Also, how are you running the generated executable?

i cut short the message displayed. It doesn't run in anyway! It neither runs through program nor manually by double clicking! (it runs fine if i use that command through command prompt)

What's the exact error message?

it's kinda big!
here it is...
"The version of this file is not compatible with the version of windows you are running. Check your computer's system information to see whether you need an x86 or x64 version of the program, and then contact software publisher"

my OS is 32 bit... Windows 7 home premium..