Try to compile your code normally as
gcc test.c
If you get default output file a.exe,then go for
gcc test.c -o test.exe
Try to compile your code normally as
gcc test.c
If you get default output file a.exe,then go for
gcc test.c -o test.exe
I would suggest you go through this compilation instruction :-
gcc -o test.exe test.c
I believe this code runs perfectly on your windows system.Please inform if it doesn't!
How to run (and compile) a C file with arguments with gcc? - Stack Overflow
why do i need to use gcc -Wall
How to run C in windows
I’m trying to run a C program in Visual Studio Code on Windows, but I’m facing two errors: (1) The terminal says 'gcc' is not recognized as an internal or external command, and (2) #include <stdio.h> is underlined with the error cannot open source file "stdio.h". How do I fix these issues and set up
Videos
I believe documentation means that you should first compile and build the program and after that call the executable with the argument. So in your case you will need to do something like:
Copygcc tw_r2fft.c -o tw_r2fft
./tw_r2fft 1024 > outputfile.c
Try this to compile the C program to an executable binary:
Copygcc -o tw_r2fft tw_r2fft.c
Then start the binary with the proper command-line arguments:
Copy./tw_r2fft 1024 >outputfile.c
Then you can compile and run your output file as well: :)
Copygcc -o test outputfile.c
./test
You need to compile your program before you can run it. To do this, you'll need a C compiler, like gcc. You can install this with:
sudo apt-get install gcc
Then, to compile your program, creating an executable called file:
gcc -Wall -o file file.c
Which you should then be able to run:
./file
Fabrice Bellard's TCC seems to be still in the repositories. It can run in a kind of interpreter-mode which makes the following possible:
You can make a simple C-file executable like the OP tried to do by adding the line
#!/usr/bin/tcc -run
to the very top of the file.
It also accepts input from STDIN by adding an empty option (just the minus sign -) at the end.
$ /usr/bin/tcc -run - <<EOF
> #include <stdio.h>
> int main()
> {
> printf("Hello World\n");
> return 0;
> }
> EOF
Hello World
or with echo
echo '#include <stdio.h> int main(){printf("Hello World\n");return 0;}' | /usr/bin/tcc -run -
or just run /usr/bin/tcc -run - type your code and start the run with CTRL + D
Seems useless and silly but the last method is the fastest (for me, YMMV etc.) to check for a function in a large library, look up the exact value of a constant etc. And it is small (180k) which makes it a good fit for e.g. the Raspberry-Pi.
Main disadvantage: development stopped (last version is from 2013).