0

I made a simple script in C on my Windows 7 64 bit machine using CodeBlocks. It basically just accepts command line arguments and then concatenates them into a char array. I compiled it on Codeblocks and it runs on my Windows 7 machine. But when I move it to the Windows XP I get error...

C:\Documents and Settings\Computer\Desktop\program.exe is not a valid Win32 application.

I am still new to C and wasn't sure if I need to put this in a Windows XP machine and compile it. I have been using the TDM-64 compiler and was thinking maybe that had to do with something. So I removed that and removed Codeblocks and then reinstalled it using the package that comes with a compiler. I then tried again and same error. So I ran the same installer on XP and compiled the code and it worked. Do I have to compile it on XP to run on XP? Or is it possible to configure Win 7 Codeblocks to make it run on XP?

Brian Jarcus
  • 69
  • 1
  • 1
  • 6
  • Please upgrade your XP machine, it's just a script kiddy playground waiting to be inducted into a botnet. Try running a diff of the build configuration between the two machines, there's probably an TargetArch or some such variable somewhere that you can set. Also, look for "cross compile" in your CodeBlocks documentation. – jwdonahue Jan 11 '18 at 23:14
  • Possible duplicate of [Program Built on Win7 won't run on WinXP](https://stackoverflow.com/questions/6311754/program-built-on-win7-wont-run-on-winxp) – Mark Benningfield Jan 12 '18 at 03:58

1 Answers1

0

Thanks to this question: Program Built on Win7 won't run on WinXP I was able to answer my question.

I had to change from "Debug" to "Release" and it was able to run.

Brian Jarcus
  • 69
  • 1
  • 1
  • 6