Author Topic: Code::Blocks C compiler not working  (Read 18575 times)

Offline kristiqn1104

  • Single posting newcomer
  • *
  • Posts: 4
Code::Blocks C compiler not working
« on: November 13, 2015, 12:26:13 am »
Hello,

I am using Code::Blocks since september  without any problems until several days ago. When I try to compile a simple C code  I am facing a very annoying problem. The execution screen is blank , empty no any output , yes I checked my code and it's 100% correct.
I am new to C programming, computer languages , compilers and I don't know how to proceed. At university I work on Unix(university's pc) and at home I am using Windows 10 64 laptop . I installed the binary release of Code::Blocks which includes  the GCC compiler, toolchain executables are auto-detected ( correctly ) .I did a reset of the compiler  to default , I reinstalled Code::Blocks several times, changed the directory to another hard drive, I deleted all files of Code::Blocks including those in hidden AppData folder, but nothing worked.
I really like Code::Blocks and I want to continue  study C language on it , I have so many projects to do for december but I've stucked.
Any suggections? :o

I am getting the following message in C::B  Build log:


mingw32-gcc.exe   -c E:\INF111\maison\Cprogramming\Enclasse.c -o E:\INF111\maison\Cprogramming\Enclasse.o
mingw32-g++.exe  -o E:\INF111\maison\Cprogramming\Enclasse.exe E:\INF111\maison\Cprogramming\Enclasse.o   
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 
Checking for existence: E:\INF111\maison\Cprogramming\Enclasse.exe
Executing: E:\CodeBlocks/cb_console_runner.exe "E:\INF111\maison\Cprogramming\Enclasse.exe" (in E:\INF111\maison\Cprogramming)


In my opinion there is nothing with the code , everything looks fine but for some reason the GCC compiler is not working properly. I don't understand how problems like this could occur when all the settings and options are set to default when I install C::B. I never changed anything in the  options that I don't understand because I know I can mess something up. It's strange that after so many compiled C codes succesfully  , the compiler got broken by  itself.


Thank You  in advance!

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Code::Blocks C compiler not working
« Reply #1 on: November 13, 2015, 01:05:30 am »
Did you try to run Enclasse.exe in command window (cmd.exe)? If yes, does it behave correctly?

Offline Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Code::Blocks C compiler not working
« Reply #2 on: November 13, 2015, 01:07:14 am »
Please, it's good to know which version of C:B you are using.
In Project->Properties->Build targets what 'Type' do you have, GUI aplication? Console aplication?
Can you run your app with the debugger, step by step, so you can tell where your app 'fails'?

Offline kristiqn1104

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks C compiler not working
« Reply #3 on: November 15, 2015, 11:36:46 am »
My Code::Blocks version is 13.12.   It is console application. After I ran it with the debugger I got this error :

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

mingw32-g++.exe  -o bin\Debug\INF111.exe obj\Debug\main.o   
e:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file bin\Debug\INF111.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))


Code::Blocks has full permissions, why is that?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks C compiler not working
« Reply #4 on: November 15, 2015, 11:42:23 am »
Two possible causes:
1. the exe is still running
2. there is an anti virus software that causes this.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline kristiqn1104

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks C compiler not working
« Reply #5 on: November 15, 2015, 11:47:08 am »
I checked in processes , the file is closed. The shields of my antivirus software are disabled.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Code::Blocks C compiler not working
« Reply #6 on: November 15, 2015, 01:15:47 pm »
I checked in processes , the file is closed. The shields of my antivirus software are disabled.
have you tried to run it in the cmd?

If you don't know how:
#1
1) Go to your output folder
2) Press and hold shift an right klick -> Open command prompt window here
3) Type the name of your exe and hit enter
Does it work?

if step 2) in #1 does not work:
1) click "start", type in the search bar "cmd.exe" and hit enter
2) enter "cd .." and hit enter. repeat this step until there is only written "C:\>"
3) Now change partition with: type "E:" and hit enter
4) now go with "cd" (=change directory) to your folder. In your example: "cd INF111\maison\Cprogramming\" (Note you can hit the TAB key for completion of folder names)
5) Type the name of your exe and hit enter
Does it work?

PS. i have written this noobie explanation, because i plan to link my future descriptions of this steps to this post.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Code::Blocks C compiler not working
« Reply #7 on: November 15, 2015, 01:16:55 pm »
The shields of my antivirus software are disabled.

What av are you using?

Offline kristiqn1104

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks C compiler not working
« Reply #8 on: November 15, 2015, 04:21:23 pm »
None of #1 and #2  worked. When I run the exe  in the cmd it still give no any  output. I have Avast installed on my pc.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Code::Blocks C compiler not working
« Reply #9 on: November 15, 2015, 04:26:22 pm »
avast started lately to block executables generated by gcc, so probably avast has blocked the creation and execution of your file.
So i would try to:
1) deactivate avast
2) Open codeblocks and rebuild the project
3) try to run it

If this does not work:
1) add your project directory, the codeblocks directory and the mingw directory to the exception of avast
2) rebuild your project

If all this does not work:
post a rebuild log here in the forum and post some code...

greetings

Tombsice

  • Guest
Re: Code::Blocks C compiler not working
« Reply #10 on: November 18, 2015, 03:37:07 pm »
I have registered to say that I too was suffering from a similar problem.
 It also manifested in that after closing the window the program was still active preventing modifications to the excutables but left old programs unafected(which had been run before and were excluded from Deep Scan).

Going to Avast's options and turning Deep Scan off and on fixed the problem for me (I was unpluged from the internet but I don't think that matters).


Edit: The problem came back but I can add files to the Deep Screen exclusions.
« Last Edit: November 18, 2015, 04:25:16 pm by Tombsice »