Author Topic: CodeBlocks opens console window, then does nothing.  (Read 27739 times)

Offline Chasian

  • Single posting newcomer
  • *
  • Posts: 3
CodeBlocks opens console window, then does nothing.
« on: November 09, 2015, 07:03:33 pm »
This just started happening today while I was trying to do a little bit of homework. I haven't changed any settings or anything like that.

Windows 10
Code::Blocks 12.12 rev 9501


So I created a program that was opening two text files and then just reading the lines in to a vector. At one point I got a error saying Permission Denied, and it wouldn't build so I just restarted my PC, as opposed to trying to hunt down the program that was stopping it.

Once it came up it looked like it built, but nothing happened. So just to make sure I opened a new project, just with hello world program in it and tried to run and got the same thing. It opens a console window and then just sits there, it has no reactions to key presses or anything but it does close out with the normal close button, I don't have to end process or anything. I have no idea why this is happening. When I close the console window it says "Process terminated with status -1073741510 .

I've already tried reinstalling
I've also tried running as administrator.

I couldn't find any other posts similar to this but if there is please link me to them.

Other then that thanks so much for your time, and if you need any more info from me just tell me what it is and I'll let you know.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Chasian

  • Single posting newcomer
  • *
  • Posts: 3
Re: CodeBlocks opens console window, then does nothing.
« Reply #2 on: November 09, 2015, 08:20:51 pm »
Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

gives in the build log

Code
-------------- Build: Debug in tesetst (compiler: GNU GCC Compiler)---------------

Target is up to date.
Nothing to be done (all items are up-to-date).


-------------- Run: Debug in tesetst (compiler: GNU GCC Compiler)---------------

Checking for existence: E:\CodeBlocks\tesetst\bin\Debug\tesetst.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "E:\CodeBlocks\tesetst\bin\Debug\tesetst.exe"  (in E:\CodeBlocks\tesetst\.)
Process terminated with status -1073741510 (0 minute(s), 2 second(s))
 




Now looking at that faq did a complete rebuild and got
 
Code

-------------- Clean: Debug in tesetst (compiler: GNU GCC Compiler)---------------

Cleaned "tesetst - Debug"

-------------- Build: Debug in tesetst (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g -std=c++11  -c E:\CodeBlocks\tesetst\main.cpp -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\tesetst.exe obj\Debug\main.o   
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot open output file bin\Debug\tesetst.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

But I can't find anything that is running in task manager that would be doing that. I am chalking this up to the fact that I'm a newbie at this. Going to restart PC and see if that does anything... let me know if any of this info gives you a hint as to what it could be.

Thanks so much!

Offline pirx67

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: CodeBlocks opens console window, then does nothing.
« Reply #3 on: November 10, 2015, 12:11:35 am »
Hi,

looking at the output of the full build log you can see:
Code
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot open output file bin\Debug\tesetst.exe: Permission denied
collect2.exe: error: ld returned 1 exit status

The GNU linker "ld" tells you that it can't open the output file it tries to write (i.e. "bin\Debug\tesetst.exe") because it was denied the permission to do so.
The second stage of the GNU compiler named "collect2.exe" tells you that the compilation was not successful because the linker "ld" returned an error code
of "1".

I would bet that there doesn't exist any "tesetst.exe" program in the output directory "bin\Debug" relative to the project directory.

Such kind of error is often caused by overeager antivirus programs. They commonly don't like programs that dynamically generate code. But that is the
purpose of a compiler. Disable your antivirus program and do a full rebuild (without run) and inspect the log for errors and the output directory for a generated output file.

In any case make sure that you have write permissions in the output directories "obj\Debug" and  "bin\Debug" relative to the project directory.

Perhaps that helps.

pirx67

Offline Chasian

  • Single posting newcomer
  • *
  • Posts: 3
Re: CodeBlocks opens console window, then does nothing.
« Reply #4 on: November 10, 2015, 03:10:52 am »
You were correct. Avast decided today was the day it was going to stop everything and anything from building.

Thanks so much!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: CodeBlocks opens console window, then does nothing.
« Reply #5 on: November 10, 2015, 08:32:57 pm »
You were correct. Avast decided today was the day it was going to stop everything and anything from building.
Another one. Sadly Avast ties in with several other famous AV solutions. Same for me - occasionally this happens to developers I guess. Meanwhile I am using the Windows built-in AV solution that works pretty well. If you keep your OS up-to-date, don't surf to weird homepages, don't open SCAM email and never trust any foreign S/" (on USB sticks or alike, using VirusTotal, for example) this should be pretty safe. Additionally it does not slow down you PC or sends everything (including documents) to the cloud for "scanning".
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ