Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run C program compiled with MinGW Dev-C++ on 64bit Vista

A few days ago I started programming with C after programming with C++, however, my Windows Vista 64bit machine was unable to create a C project. I recompiled the code with the MinGW Dev-C++ compiler without issue.

However, when I ran the code I received the following error:

Unsupported 16-Bit Application

The program or feature "\??\C:\Dev-Cpp\gcc.exe" cannot start or run due to incompatibity with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available.

Is this a problem with compiling C code using a C++ compiler?

like image 472
Sheldon Allen Avatar asked Sep 21 '11 21:09

Sheldon Allen


2 Answers

The error you're seeing is from using an ancient (as in 16-bit Windows 3.1 era) software that Windows 64-bit does not provide backwards-compatibility for. This has nothing to do with C or C++, just a really old compiler.

You can either install windows 7 with XP-mode, which provides a virtual 32-bit XP machine running nearly seamlessly under Windows 7, or some other 32-bit virtualization solution or download a newer version of gcc.exe or some other compiler that's less than 20 years old:

See cygwin, MingGW, or Visual Studio Express.

like image 152
Eclipse Avatar answered Sep 20 '22 11:09

Eclipse


I got the same error message when accidentally adding the -c switch which tells the compiler to not link the executable. Removing the switch made it work again.

> gcc --help

...

-c Compile and assemble, but do not link

like image 26
msiemens Avatar answered Sep 21 '22 11:09

msiemens