Friday, July 31, 2009

I get an error when I try to load my program... I know the codes correct I made an exact copy, whats this mean

So I copied the following code into Dev C++ 4.9.9.2





#include %26lt;iostream.h%26gt;





int main();


{


cout %26lt;%26lt; "Hello!\n";


return 0;


}





and I ran it and for some reason it says the following:





C:documen....


The NTVDM CPU has encountered an illegal instruction


CS:0dbc IP:0103 OP:63 6c 75 64 65 Choose 'close' to terminate the application...





What to do to fix this?


The code is correct for sure and it's saved as .exe so no problem there...

I get an error when I try to load my program... I know the codes correct I made an exact copy, whats this mean
It seems that the compiler optimized the code wrongly. Try changing the compilation options for a more general CPU architecture, like i386. The source seems correct like you said, however, get rid of the semicolon after main().





And yeah, if you saved your source as an exe, of course it will not run, you need to compile it first.
Reply:When you say the code is saved as .exe, do you mean literally that. If so it can not work. The compiled programme needs to be the executable.

flamingo plant

No comments:

Post a Comment