I have a similar problem as Lelio83, even though I haven't formatted my computer. DevC++ was running absolutely fine for me, until suddenly one day, after compiling my code for the second time I got a compilation error "Invalid Argument, Id returned 1 exit status", so I tried to make some changes in my code, n then on compiling I got the error "Permission Denied , Id returned 1 exit status". After running any of my code for the first time , if I make any changes and try to compile it again, I encounter the same problem again. I read the solutions mentioned in the previous post by Lelio83, but none seem to be applicable to me. I even tried uninstalling Dev-C++ as mentioned in the uninstall instructions and deleted the devcpp.ini and .cfg files and reinstalled ... But am facing the same problems.
My Basic 3 is :
1) Version - Dev-C++ 4.9.9.2
2) Compile Log
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Cfiles\exp.c" -o "C:\Cfiles\exp.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: cannot open output file C:\Cfiles\exp.exe: Permission denied
collect2: ld returned 1 exit status
Execution terminated
3) Code Producing this problem :
include<stdio.h>
include<stdlib.h>
include<math.h>
int main()
{
double n, inter=0, out, k=0;
int integer =0;
printf("Enter n value : ");
scanf("%lf", &n);
inter = (n*1000 +0.5);
integer = (int)inter;
printf("\n integer = %d", integer);
inter = integer;
printf("\n inter = %f", inter);
out = inter/1000;
printf("\n out = %f", out);
getch();
return 0;
}
I hope you could throw some light as to what the problem is or where am going wrong !
Thanks
Anna
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have no idea why these problems are suddenly occurring. I am tempted to suggest that if you need to get work done, don't waste time with it, there are better tools available with fewer problems and platform issues. If you have an existing investment in Dev-C++ projects, then you might try wxDev-C++, otherwise cur your losses, and use VC++ 2005 Express.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is just something I noticed with your code.
I thought it was not possable to initialise variables the way you have,like this...
int a, b = 0, c ;
but that initialised variables must be on the right hand side like...
int a, c, b = 0, d = 0 ; etc
or is that my bad learning?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-10-25
It is valid, just not nice. I think you are thinking of the following assignment construct:
a = b = c = 0 ;
Most coding standards applied in professional development organisations require that each variable be declared in a separate statement:
int a ;
int b = 0 ;
int c ;
... and for good reason (in fact several).
However it would be unfair to continue this unrelated discussion. I always suggest that the minimum amount of code needed to reproduce the error should be posted, exactly in order to avoid this kind on well intended but essentially irrelevant digression from the OP's problem at hand. In this case I suspect that:
int main(){}
(which is as short as a C++ program can be) would have sufficed since it is not a code related issue. I would have been happy to see no code in this instance, but that would require that the OP knows that it is not code related. Often they insist that it isn't when it in fact is, so I'd hesitate to question Wayne's "Basic 3" mantra.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Everyone !
I have a similar problem as Lelio83, even though I haven't formatted my computer. DevC++ was running absolutely fine for me, until suddenly one day, after compiling my code for the second time I got a compilation error "Invalid Argument, Id returned 1 exit status", so I tried to make some changes in my code, n then on compiling I got the error "Permission Denied , Id returned 1 exit status". After running any of my code for the first time , if I make any changes and try to compile it again, I encounter the same problem again. I read the solutions mentioned in the previous post by Lelio83, but none seem to be applicable to me. I even tried uninstalling Dev-C++ as mentioned in the uninstall instructions and deleted the devcpp.ini and .cfg files and reinstalled ... But am facing the same problems.
My Basic 3 is :
1) Version - Dev-C++ 4.9.9.2
2) Compile Log
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Cfiles\exp.c" -o "C:\Cfiles\exp.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: cannot open output file C:\Cfiles\exp.exe: Permission denied
collect2: ld returned 1 exit status
Execution terminated
3) Code Producing this problem :
include<stdio.h>
include<stdlib.h>
include<math.h>
int main()
{
double n, inter=0, out, k=0;
int integer =0;
printf("Enter n value : ");
scanf("%lf", &n);
inter = (n*1000 +0.5);
integer = (int)inter;
printf("\n integer = %d", integer);
inter = integer;
printf("\n inter = %f", inter);
out = inter/1000;
printf("\n out = %f", out);
getch();
return 0;
}
I hope you could throw some light as to what the problem is or where am going wrong !
Thanks
Anna
There are currently two threads regarding this issue. Have you also looked at http://sourceforge.net/forum/forum.php?thread_id=1845164&forum_id=48211 ? I have asked RDS for further information, but I guess since his problem is solved he is no longer interested.
I have no idea why these problems are suddenly occurring. I am tempted to suggest that if you need to get work done, don't waste time with it, there are better tools available with fewer problems and platform issues. If you have an existing investment in Dev-C++ projects, then you might try wxDev-C++, otherwise cur your losses, and use VC++ 2005 Express.
Clifford
This is just something I noticed with your code.
I thought it was not possable to initialise variables the way you have,like this...
int a, b = 0, c ;
but that initialised variables must be on the right hand side like...
int a, c, b = 0, d = 0 ; etc
or is that my bad learning?
It is valid, just not nice. I think you are thinking of the following assignment construct:
a = b = c = 0 ;
Most coding standards applied in professional development organisations require that each variable be declared in a separate statement:
int a ;
int b = 0 ;
int c ;
... and for good reason (in fact several).
However it would be unfair to continue this unrelated discussion. I always suggest that the minimum amount of code needed to reproduce the error should be posted, exactly in order to avoid this kind on well intended but essentially irrelevant digression from the OP's problem at hand. In this case I suspect that:
int main(){}
(which is as short as a C++ program can be) would have sufficed since it is not a code related issue. I would have been happy to see no code in this instance, but that would require that the OP knows that it is not code related. Often they insist that it isn't when it in fact is, so I'd hesitate to question Wayne's "Basic 3" mantra.
Clifford
I've got a similar problem. It came from Sbybot, exactly from teatimer.exe. If you are using this stuff or a similar one just kill the process.
Eric
Thanks Eric, that sounds like a plausible explanation. http://www.safer-networking.org/en/faq/33.html