user688661
user688661

Reputation: 11

How can one generate .out in Code Blocks in Ubuntu.?

I have just shifted to ubuntu. Earlier I used to write my code in Code Blocks for windows. Compile using it. But running the exe from the console as in abc.exe < input.in. Hated giving output again & again. Following it in Ubuntu I installed CodeBlocks for Ubuntu but in linux as well it generates .exe and .o which do not works in linux according to my knowledge. Also I know that I have to run like ./abc.out < input.in . So now I want code blocks to generate .out. If this is not possible please suggest Some other method.

Upvotes: 0

Views: 219

Answers (1)

sarnold
sarnold

Reputation: 104080

If I understood your question correctly, you want to know how to name an executable while compiling it. If so, you can use the -o <filename> flag to gcc(1):

$ cat hello.c
#include <stdio.h>

int main(int argc, char* argv[]) {
    printf("%s\n", "hello world!");
    return 0;
}
$ gcc -o hello hello.c
$ ./hello
hello world!
$ 

Upvotes: 1

Related Questions