I'm using DevC++ 4.9.9.2 On an AMD939 machine running WinXP64.
I am writing some simple programs to start as I am learning C. The first run goes well it compiles then runs.
When I add to the program, save to disk, compile this is where I notice the first change the popup that shows the compiler has done closes itself straight away. Then I run the program and it displays in a console as the original program. Here are the two progs before:
int main()
{
// note the adition of two sets of escape sequences \n
printf("Sorry. can't talk now.\n\n");
printf("\n\nI'm busy!");
system("pause");
return (0);
}
LOG:
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "D:\C-Programming\B1C2\hello.c" -o "D:\C-Programming\B1C2\hello.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 D:\C-Programming\B1C2\hello.exe: Invalid argument
collect2: ld returned 1 exit status
Execution terminated
I have even tried to delete the hello.c and hello.exe files but the hello.exe file would not delete.
I realize in the log there is a line "cannot open output file..." if anyone can help me out here I would be most grateful.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-10-15
The program does not change because it cannot write to the executable (so it does not change!).
This will happen if an existing instance of the program is still running - perhaps waiting as the "pause" command.
Thanks for the speedy reply. I have seen the thread you are referring to (there are some others with this problem too and they don’t seem to have sorted it ither) I wonder if that one is on a 64bit system? Similarly I have to restart the system before I the program is released. I have also tried the suggested method of using task Manager to close any Applications or Processes. I is defiantly the system("PAUSE"); that is causing the problem as I have run the prog' without this instruction and the problem doesn’t appear. So In the end I have sent an e-mail to bloodshed to see if they know of this problem. I did notice that there were references to setting up DevC++ in Vista can anyone redirect me to this area? As I hope this has something that may through some light on a 64bit setup.
Thanks again for your help and I'll let you know what the outcome from Bloodshed is.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-10-15
This does not look like the known Vista issue; but the direction you are looking for are in the thread called "PLEASE READ BEFORE POSTING A QUESTION" (Oh the irony!).
The system("pause") call is just a kludge so that when you run the code form the IDE you can see the output. It has to invoke cmd.exe and run the built-in shell pause command. It is somewhat heavyweight and involves a huge amount of code and OS dependence. Just stop using it.
Instead use this function:
void pause()
{
fflush(stdin) ; // THIS IS A NON-PORTABLE KLUDGE!
printf( "Press ENTER to continue..." ) ;
getchar() ;
}
Note the warning - the standard library does not define fflush for input streams. It works because you are using Microsoft's C library which does define it. But since the pause kludge is normally a temporary thing you might decide to live with it. Given that system("pause") is not portable to shells that do not have the pause command (like Linux for example), it is no real sacrifice.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DOH,
You wre right again I hadn't checked to see if the devcpp.* files had been compleatly removed, but with that done it seen to be working (for the time being).
I thank you from the hart of my bottom:-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem has returned with next startup of the computer. I have found one fix that has seemed to worked on the two computers that I had this problem on and that is delete the profile and set yourself up with a different user name (new user)run devc++ and setup as per a new install. Try this for vista if it works, you never know your luck!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-10-20
If that is the solution, just to get some background regarding the possible causes of the problem (for future reference) did you install Dev-C++ for "All users" or "Current user" - since it seems to be related to the profile, perhaps there is an issue there.
Thanks,
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With the risk of jumping on the "ME TOO!"-train:
I had the same problem, and it turned out to be Spybot that caused the problems! I’ve been averaging on 200 new files a day, because I had to use “save as” every time I wanted to try a new change. Thank you for giving me the solution!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-11-27
>> I’ve been averaging on 200 new files a day, because I had to use
>> “save as” every time I wanted to try a new change.
Yuk! Use a proper version control system! SubVersion is good, but CVS integrates with Dev-C++ (apparently - never tried it). There are of course commercial tools as well.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using DevC++ 4.9.9.2 On an AMD939 machine running WinXP64.
I am writing some simple programs to start as I am learning C. The first run goes well it compiles then runs.
When I add to the program, save to disk, compile this is where I notice the first change the popup that shows the compiler has done closes itself straight away. Then I run the program and it displays in a console as the original program. Here are the two progs before:
include <stdio.h>
include <stdlib.h>
int main()
{
printf("Sorry. can't talk now.");
printf("I'm busy!");
system("pause");
return (0);
}
after:
include <stdio.h>
include <stdlib.h>
int main()
{
// note the adition of two sets of escape sequences \n
printf("Sorry. can't talk now.\n\n");
printf("\n\nI'm busy!");
system("pause");
return (0);
}
LOG:
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "D:\C-Programming\B1C2\hello.c" -o "D:\C-Programming\B1C2\hello.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 D:\C-Programming\B1C2\hello.exe: Invalid argument
collect2: ld returned 1 exit status
Execution terminated
I have even tried to delete the hello.c and hello.exe files but the hello.exe file would not delete.
I realize in the log there is a line "cannot open output file..." if anyone can help me out here I would be most grateful.
The program does not change because it cannot write to the executable (so it does not change!).
This will happen if an existing instance of the program is still running - perhaps waiting as the "pause" command.
There is a current thread regarding a problem that sounds similar. http://sourceforge.net/forum/forum.php?thread_id=1844655&forum_id=48211 but we are not getting very far with him!
Check the file attributes to see that it is not somehow read-only.
Thanks for the speedy reply. I have seen the thread you are referring to (there are some others with this problem too and they don’t seem to have sorted it ither) I wonder if that one is on a 64bit system? Similarly I have to restart the system before I the program is released. I have also tried the suggested method of using task Manager to close any Applications or Processes. I is defiantly the system("PAUSE"); that is causing the problem as I have run the prog' without this instruction and the problem doesn’t appear. So In the end I have sent an e-mail to bloodshed to see if they know of this problem. I did notice that there were references to setting up DevC++ in Vista can anyone redirect me to this area? As I hope this has something that may through some light on a 64bit setup.
Thanks again for your help and I'll let you know what the outcome from Bloodshed is.
This does not look like the known Vista issue; but the direction you are looking for are in the thread called "PLEASE READ BEFORE POSTING A QUESTION" (Oh the irony!).
The system("pause") call is just a kludge so that when you run the code form the IDE you can see the output. It has to invoke cmd.exe and run the built-in shell pause command. It is somewhat heavyweight and involves a huge amount of code and OS dependence. Just stop using it.
Instead use this function:
void pause()
{
fflush(stdin) ; // THIS IS A NON-PORTABLE KLUDGE!
printf( "Press ENTER to continue..." ) ;
getchar() ;
}
Note the warning - the standard library does not define fflush for input streams. It works because you are using Microsoft's C library which does define it. But since the pause kludge is normally a temporary thing you might decide to live with it. Given that system("pause") is not portable to shells that do not have the pause command (like Linux for example), it is no real sacrifice.
Clifford
DOH,
You wre right again I hadn't checked to see if the devcpp.* files had been compleatly removed, but with that done it seen to be working (for the time being).
I thank you from the hart of my bottom:-)
The problem has returned with next startup of the computer. I have found one fix that has seemed to worked on the two computers that I had this problem on and that is delete the profile and set yourself up with a different user name (new user)run devc++ and setup as per a new install. Try this for vista if it works, you never know your luck!!
If that is the solution, just to get some background regarding the possible causes of the problem (for future reference) did you install Dev-C++ for "All users" or "Current user" - since it seems to be related to the profile, perhaps there is an issue there.
Thanks,
Clifford
This could also be a problem with Spybot - S&D, if you have it installed, that is.
Apparently, it's the TeaTimer resident scanner that causes the problem. Close it while coding.
Oh, and, this problem is not specific to Dev-C++. I've had the same problem with Visual C++ 2005 Express as well.
With the risk of jumping on the "ME TOO!"-train:
I had the same problem, and it turned out to be Spybot that caused the problems! I’ve been averaging on 200 new files a day, because I had to use “save as” every time I wanted to try a new change. Thank you for giving me the solution!
>> I’ve been averaging on 200 new files a day, because I had to use
>> “save as” every time I wanted to try a new change.
Yuk! Use a proper version control system! SubVersion is good, but CVS integrates with Dev-C++ (apparently - never tried it). There are of course commercial tools as well.
Clifford
I have SpyBot and TeaTimer on three computers and I've never had that problem. I wonder if it's an older version that causes it?