Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeblocks takes long time to execute after compiling

Tags:

c++

c

codeblocks

I am having a strange problem with Code:Blocks. After writing C program i click on Build and run, it compiles in fraction of a second but then a new window opens and after around 12 seconds output appears on the window. It takes this much time for even basic code like

#include<stdio.h>
int main()
{
    printf("HELLO");
    return 0;
}

Here are snapshots of what happens. As I am not allowed to post images{new to forum} I am posting links.

When I click on build and run, this window appears in no time

enter image description here

Then after around 10-12 seconds, this window appears. As you can see it says that execution time took 11 seconds.

enter image description here

Any idea why this is happening? How to fix it? I did no tweaks to code:blocks and settings are same as they come by default.

like image 912
Ignited Avatar asked Mar 01 '14 09:03

Ignited


People also ask

Why are CodeBlocks so slow?

I faced the same issue. Later I found out that, its due to antivirus. I don't have any antivirus install in my PC. It was windows Virus and threats protection which was running all the time, which make execution slow.

Why is Codeblock not compiling?

You don't have a compiler or you haven't configured CodeBlocks with a compiler.To fix it: Download and Install a C/C++ compiler for your OS and configure CodeBlocks to use it. Or if you are using Windows you can also download this CodeBlocks setup which already includes MinGW compiler.

How much RAM does CodeBlocks use?

Re: What Is The Minimum PC Requirement for codeblocks to run? A machine capable of running Windows XP and 512mb free ram after the OS has been started. For linux is a similar... 512mb free ram after the OS has been started.


3 Answers

For any Avast user reading this

  1. Open the interface
  2. Go to settings
  3. Go to general
  4. Scroll down and you will find 'exclusion'
  5. Enter the directory in which your CodeBlocks is installed. Also enter the directory in which you have saved your project.
like image 26
Vijay Kumar Avatar answered Sep 23 '22 07:09

Vijay Kumar


The problem was with antivirus. Whitlisting gcc,g++ and codeblocks solved the problem.

like image 192
Ignited Avatar answered Sep 23 '22 07:09

Ignited


I faced the same issue. Later I found out that, its due to antivirus. I don't have any antivirus install in my PC. It was windows Virus and threats protection which was running all the time, which make execution slow.

What I did is, Go to Manage settings. After that you will found Exclusions somewhere. Go to exclusions. Then go to Add/remove exclusions. There just add the folder where your .c or .cpp file is created. And then you are done.

Adding a youtube link which can be useful [https://www.youtube.com/watch?v=OaQQsDIsc8o]

like image 41
milky_way Avatar answered Sep 23 '22 07:09

milky_way