I just downloaded and installed the lcc64 compiler. To test if it works, i compiled this program
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("test");
return 0;
}
by using lcc64.exe Source.c -o prog.exe
.
But if i try to start the program prog.exe
in console,
a window pops up saying "Unsupported 16 bit application", "The Program or feature '\??\C:\lcc\lcc\bin\prog.exe' cant be opened due to an incompatibility with 64-bit versions of Windows."
What am i doing wrong?
First, I strongly recommend that you download and use the user manual for lcc that is available on the project page.
The problem here is that the compiler does not produce executable files - it produces object files. You need to then use the linker to produce the executable file. You've overridden the standard output of the compiler to name the .obj
file it produces prog.exe
, but naming an .obj
file an .exe
file does not make it an executable. To get your test to work, in the simplest way, you need to:
..\test> lcc64 source.c
this produces a file source.obj
. You then need to
..\test> lcclnk64 source.obj
this produces a file source.exe
. Running the file then produces output :
..\test> source
test
For a larger project you would typically be writing and maintaining a build script that manages the correct order of compilation and linking for all of the sources into the final executable.