Carramba said:
hi!
thanx for taking time to read my post.
code
#include <stdio.h>
int main() {
printf("Hello word!");
return 0;
}//END
when Iam compiling code with gcc I can't start program in winXP by
doubleclicking it, but if I do it with msvisual c++ I can
Why is that, and how to configure the compiler to work properly?
I thought under Windows GCC was called something else, like DJPP or
EGCS. Anyway, I believe this is because XP has really, really, really
crappy backwards support, like for old DOS programs (even worse legacy
support than 95/98 did). XP sees a program that calls the printf()
function and says, "Oh, a DOS program, I'll just sit here and do nothing
while he double-clicks like mad." You would have to open a DOS shell
and enter the prog.exe command or fiddle with the properties somehow
(forget exactly how, let's just say that getting DOS games, even ones as
recent as 1995, to run on XP is a chore) to run your little Hello World
in a DOS shell automatically. Visual Studio, OTOH, has a built-in DOS
shell, because they know that plenty of people (students, for instance)
will be writing programs to learn on that only use the standard
libraries and no WIN32 stuff.
Isn't XP grand?
--
----- BEGIN GEEK CODE BLOCK -----
Version 3.1
GAT d? !s !a C++++ UL+ P L++ E- W+ N+ o-- K- w--
O- !M !V PS-- PE++ Y+ PGP- t++>++++* 5? !X-- R- tv b++ DI+ D++
G e !h !r !y
...... END GEEK CODE BLOCK ----