kile
kile

Reputation: 141

Why can I not build and run this in Code blocks?

enter image description hereHere is my code

#include <stdio.h>
int main()
{
    int a;
    int b = 9;
    printf("input a integer: ");
    scanf("%d",&a);
    printf("%d + %d = %d\n",a,b,a+b);
    return(0);
}

Build message:

||=== Build file: "no target" in "no project" (compiler: unknown) ===|
ld.exe||cannot open output file G:\document\C++ and C\Add and Input.exe Permission denied|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I think my code is right. But I can't get it right to run smoothly.

Upvotes: 0

Views: 3741

Answers (1)

Saif Faidi
Saif Faidi

Reputation: 529

Follow these steps to configure your project with CodeBlocks (in my case the project name is "containers").

1 - right click on your project icon :

enter image description here

2 - select "build options for debug or/and release:"

enter image description here

3- select "compiler settings" and then check the box corresponding to your option :

enter image description here

Upvotes: 1

Related Questions