User forums > Help
Code::Blocks console won't close.
perento:
Hello i just downloaded free Clode Blocks IDE from codeblocks.org and it was all great,
but after 2 weeks or so Code::blocks console wouldnt close so i remove it from my PC and i downloaded it again for free from the same web but again i tryed to compile a small code, it compile fine except saying this:
Process returned -1073741510 <0xC000013A> execution time : 12.42 s
Press any key to continue.
And i cant close to console. I tryed from the little X in top right, tryed whit right mouse button to close it from the minimized in the start menu, also tryed whit Task Manager wich couldnt help at all. I resstart my PC andconsole is closed, ofcourse.
I have DevC++ on my PC but since i know abotu Code::blocks, it becomes my IDE! So easy to work whit and comfortable.
Im using the latest C::B on my 32bit computer, please help me i really dont want to switch my IDE whit DevC or Visual for ever.
regards -perento
JackDawson:
--- Quote from: perento on December 04, 2011, 12:21:19 pm ---Hello i just downloaded free Clode Blocks IDE from codeblocks.org and it was all great,
but after 2 weeks or so Code::blocks console wouldnt close so i remove it from my PC and i downloaded it again for free from the same web but again i tryed to compile a small code, it compile fine except saying this:
Process returned -1073741510 <0xC000013A> execution time : 12.42 s
Press any key to continue.
And i cant close to console. I tryed from the little X in top right, tryed whit right mouse button to close it from the minimized in the start menu, also tryed whit Task Manager wich couldnt help at all. I resstart my PC andconsole is closed, ofcourse.
I have DevC++ on my PC but since i know abotu Code::blocks, it becomes my IDE! So easy to work whit and comfortable.
Im using the latest C::B on my 32bit computer, please help me i really dont want to switch my IDE whit DevC or Visual for ever.
regards -perento
--- End quote ---
Try this code and see if your still getting that error.
--- Code: ---#include <iostream>
#include <conio.h>
#include <cstdlib>
using namespace std;
int main()
{
unsigned key;
do
{
cout << "0) Play again"
<< endl
<< "1) Quit" << endl;
key = getche();
cout.put('\x8');
}while(key != '1');
return 0;
}
--- End code ---
If you are, then your most likely missing some sort of DLL that talks to Windows. Are you on XP ? If so, then make sure to install the Windows SDK. If your on Vista or Windows 7, then try installing the Windows 7 SDK. This really should not be the way to solve it, but I have noticed that there are missing DLLs from some computers. So just try the code I provided above first and if that does not work, then install a SDK.
Also, make sure you start a new application for the console before pasting the code above.
Also, you didn't post any source code, so there is really no way to know why it will not close. You could be using code that actually prevents it from closing the normal way. So again, this is not going to get solved without further info from you.
On another note, how come your not using the MingW C++ compiler ? The Dev-CPP version is outdated and not supported last I heard. MingW is updated, free and comes with C::B if you chose the right install file.
perento:
Im using XP and my both C::B was whit mingW compiler. The reason i didnt post any source code is that it happend whit 2 of my projects here is the small one, was trying to understand the kbhit() function wich still didnt but thats other topic.
#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
int main() //Main Function
{
while(1)
{
if(kbhit()) //return TRUE if key is hited
{
cout << "spam 2" << endl;
}
else
{
cout << "spam" << endl;
}
Sleep (1000);
}
return 0;
}
sorry for not putting the code in frames but i dont know how, im sorry :(
That bug whit un-closable console dotn happen every time, it did randomly, and whit your code i execute like 5 times and all was fine, then i open the project i pasted above and execute few times and nothing happend again. I didnt changed nothing at all but if happen again ill try donwloading SDK, can u please post me a link.
-perento
JackDawson:
--- Code: ---#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
int main() //Main Function
{
while(1)
{
if(kbhit()) //return TRUE if key is hited
{
cout << "spam 2" << endl;
}
else
{
cout << "spam" << endl;
}
Sleep (1000);
}
return 0;
}
--- End code ---
Ok couple things :
kbhit() - It returns a non-zero integer if a key is in the keyboard buffer. In other words if there is a key that has been pressed and its in the Keyboard Buffer, this function will return back any number except 0. If no key has been pressed, and there is no key in the buffer, then it is the only time it should send back a 0. ( Example, if its 0 then the answer is FALSE. If its anything other then 0 then its TRUE )
And I tested your code in MinGW, it works fine. Also the console closes fine as well. Of course i'm on Windows 7. So not sure why it makes a difference from Windows XP.
perento:
I dont think its in the code since happens whit fe of my projects, they arent big codes
I was spaming compile on few projects and the console seems fine, i might post again whit further info if hapens again and probably going to donwload Windows SDK file
PS: about the kbhit function, i know what is doing but just cant find a place in some source code
Thanks for help JackDawson!
Navigation
[0] Message Index
[#] Next page
Go to full version