MinGW *.exe not a valid win32 application

Started by
15 comments, last by Aardvajk 9 years, 8 months ago

Been banging my head on the wall.

Windows 7

Eclipse Helios CDT

MinGW toolchain.

Simple hello world compiled gives this error, and I have not idea. Googled for two hours and searched all property dialogs to find nothing.

GAHHHH!!!! Ironically I just read this article the other day and thought "Well that's not true." http://www.drdobbs.com/tools/just-let-me-code/240168735

Anyways, any help is appreciated.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Advertisement

On a side note, I just downloaded Visual Studio 2010 so eclipse would "just work." It doesn't. It seems while I was working with libraries and Java and the web and stuff, C++ by hand because something that a new programmer can't do anymore, which is kind of sad.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Can you share the corrupt exe file?
Which MinGW version are you using? I'm using TDM-GCC 4.8.1 with Eclipse Luna (before that with Kepler and Juno) and never had any problem like that.

I have the same version. Just downloaded it on Friday. I am also using the newest Eclipse (Luna).

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

This can happen if you've accidentally targeted a different architecture from the one you're running, so give the project settings a check. You could be building a 64-bit binary and then trying to run it on a 32-bit copy of Windows, as an example.

This can happen if you've accidentally targeted a different architecture from the one you're running, so give the project settings a check. You could be building a 64-bit binary and then trying to run it on a 32-bit copy of Windows, as an example.

I'm on windows 7, so there should be no problem running either 32 or 64 bit apps. I have been trying to find a setup for teaching C++ that could use as many of the same tools as possible but still allow for Mac, Widows, or Linux. I settled on Eclipse, but I had hoped installing and configuring the libraries and tool chains would be easier.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

What happens if you compile hello world from the command line using MinGW? At least that should tell you if the problem is the compiler or the IDE.

Put hello.cpp in a directory, command just g++ hello.cpp, then run a.out.

(This assumes your bin and include directories are set up by default, may not be the case if you have only used it via the IDE)

I've not had this problem with MinGW myself.


What happens if you compile hello world from the command line using MinGW? At least that should tell you if the problem is the compiler or the IDE.

This was my thought for a next step. I'll try it tonight. I suspect I did something weird when installing it. It seemed like a lot places to go wrong are built into the installer.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

This can happen if you've accidentally targeted a different architecture from the one you're running, so give the project settings a check. You could be building a 64-bit binary and then trying to run it on a 32-bit copy of Windows, as an example.


I'm on windows 7, so there should be no problem running either 32 or 64 bit apps. I have been trying to find a setup for teaching C++ that could use as many of the same tools as possible but still allow for Mac, Widows, or Linux. I settled on Eclipse, but I had hoped installing and configuring the libraries and tool chains would be easier.


Windows 7 has both 32-bit and 64-bit editions. Definitely find out for sure which you're using!

http://windows.microsoft.com/en-us/windows7/find-out-32-or-64-bit

This topic is closed to new replies.

Advertisement