gcc: no input files [duplicate]

Clash Royale CLAN TAG#URR8PPP up vote
0
down vote
favorite
This question already has an answer here:
Compiling C codes in Ubuntu
3 answers
I have installed Ubuntu subsystem in Windows 10 and I also installed gcc. I wrote a simple Hello world C program and saved it in documents. When I try to compile this program I get this answer:
Tony316@DESKTOP-2ONG1CO:~$ gcc Hello.c -o Hello
gcc: error: Hello.c: No such file or directory
gcc: fatal error: no input files compilation terminated.
I think I have to put my Hello World program in the correct file for gcc to find it, but I don't know how to compile it.
I know this question may have been asked before from users that run only ubuntu in their PC, but I am running it on Windows 10 and I couldn't find anything relevant
gcc windows-subsystem-for-linux
marked as duplicate by karel, Eric Carvalho, waltinator, Andrea Lazzarotto, pa4080 Mar 25 at 17:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
This question already has an answer here:
Compiling C codes in Ubuntu
3 answers
I have installed Ubuntu subsystem in Windows 10 and I also installed gcc. I wrote a simple Hello world C program and saved it in documents. When I try to compile this program I get this answer:
Tony316@DESKTOP-2ONG1CO:~$ gcc Hello.c -o Hello
gcc: error: Hello.c: No such file or directory
gcc: fatal error: no input files compilation terminated.
I think I have to put my Hello World program in the correct file for gcc to find it, but I don't know how to compile it.
I know this question may have been asked before from users that run only ubuntu in their PC, but I am running it on Windows 10 and I couldn't find anything relevant
gcc windows-subsystem-for-linux
marked as duplicate by karel, Eric Carvalho, waltinator, Andrea Lazzarotto, pa4080 Mar 25 at 17:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
"saved it in documents."? But you're tellinggccthat it's in the current directory. What doesgcc Documents/Hello.c -o Helloproduce.
â waltinator
Mar 23 at 14:13
I run it and this is what comes out: Tony316@DESKTOP-2ONG1CO:~$ gcc Documents/Hello.c -o Hello gcc: error: Documents/Hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
â Tony316
Mar 23 at 14:23
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
Compiling C codes in Ubuntu
3 answers
I have installed Ubuntu subsystem in Windows 10 and I also installed gcc. I wrote a simple Hello world C program and saved it in documents. When I try to compile this program I get this answer:
Tony316@DESKTOP-2ONG1CO:~$ gcc Hello.c -o Hello
gcc: error: Hello.c: No such file or directory
gcc: fatal error: no input files compilation terminated.
I think I have to put my Hello World program in the correct file for gcc to find it, but I don't know how to compile it.
I know this question may have been asked before from users that run only ubuntu in their PC, but I am running it on Windows 10 and I couldn't find anything relevant
gcc windows-subsystem-for-linux
This question already has an answer here:
Compiling C codes in Ubuntu
3 answers
I have installed Ubuntu subsystem in Windows 10 and I also installed gcc. I wrote a simple Hello world C program and saved it in documents. When I try to compile this program I get this answer:
Tony316@DESKTOP-2ONG1CO:~$ gcc Hello.c -o Hello
gcc: error: Hello.c: No such file or directory
gcc: fatal error: no input files compilation terminated.
I think I have to put my Hello World program in the correct file for gcc to find it, but I don't know how to compile it.
I know this question may have been asked before from users that run only ubuntu in their PC, but I am running it on Windows 10 and I couldn't find anything relevant
This question already has an answer here:
Compiling C codes in Ubuntu
3 answers
gcc windows-subsystem-for-linux
gcc windows-subsystem-for-linux
edited Mar 25 at 17:45
Zanna
48k13119228
48k13119228
asked Mar 23 at 14:10
Tony316
6
6
marked as duplicate by karel, Eric Carvalho, waltinator, Andrea Lazzarotto, pa4080 Mar 25 at 17:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by karel, Eric Carvalho, waltinator, Andrea Lazzarotto, pa4080 Mar 25 at 17:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
"saved it in documents."? But you're tellinggccthat it's in the current directory. What doesgcc Documents/Hello.c -o Helloproduce.
â waltinator
Mar 23 at 14:13
I run it and this is what comes out: Tony316@DESKTOP-2ONG1CO:~$ gcc Documents/Hello.c -o Hello gcc: error: Documents/Hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
â Tony316
Mar 23 at 14:23
add a comment |Â
"saved it in documents."? But you're tellinggccthat it's in the current directory. What doesgcc Documents/Hello.c -o Helloproduce.
â waltinator
Mar 23 at 14:13
I run it and this is what comes out: Tony316@DESKTOP-2ONG1CO:~$ gcc Documents/Hello.c -o Hello gcc: error: Documents/Hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
â Tony316
Mar 23 at 14:23
"saved it in documents."? But you're telling
gcc that it's in the current directory. What does gcc Documents/Hello.c -o Hello produce.â waltinator
Mar 23 at 14:13
"saved it in documents."? But you're telling
gcc that it's in the current directory. What does gcc Documents/Hello.c -o Hello produce.â waltinator
Mar 23 at 14:13
I run it and this is what comes out: Tony316@DESKTOP-2ONG1CO:~$ gcc Documents/Hello.c -o Hello gcc: error: Documents/Hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
â Tony316
Mar 23 at 14:23
I run it and this is what comes out: Tony316@DESKTOP-2ONG1CO:~$ gcc Documents/Hello.c -o Hello gcc: error: Documents/Hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
â Tony316
Mar 23 at 14:23
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
As I understand it (this is a result of some quick research), the Bash environment in Windows has two separate "home" directories: one containing your Windows files and the other containing files such as .bashrc and other traditional home directory files found in Linux. To navigate to your Windows Document folder type: cd /mnt/c/Users/yourusername/Documents/. From there, compile your program using gcc with gcc Hello.c -o Hello.
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
As I understand it (this is a result of some quick research), the Bash environment in Windows has two separate "home" directories: one containing your Windows files and the other containing files such as .bashrc and other traditional home directory files found in Linux. To navigate to your Windows Document folder type: cd /mnt/c/Users/yourusername/Documents/. From there, compile your program using gcc with gcc Hello.c -o Hello.
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
add a comment |Â
up vote
3
down vote
As I understand it (this is a result of some quick research), the Bash environment in Windows has two separate "home" directories: one containing your Windows files and the other containing files such as .bashrc and other traditional home directory files found in Linux. To navigate to your Windows Document folder type: cd /mnt/c/Users/yourusername/Documents/. From there, compile your program using gcc with gcc Hello.c -o Hello.
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
add a comment |Â
up vote
3
down vote
up vote
3
down vote
As I understand it (this is a result of some quick research), the Bash environment in Windows has two separate "home" directories: one containing your Windows files and the other containing files such as .bashrc and other traditional home directory files found in Linux. To navigate to your Windows Document folder type: cd /mnt/c/Users/yourusername/Documents/. From there, compile your program using gcc with gcc Hello.c -o Hello.
As I understand it (this is a result of some quick research), the Bash environment in Windows has two separate "home" directories: one containing your Windows files and the other containing files such as .bashrc and other traditional home directory files found in Linux. To navigate to your Windows Document folder type: cd /mnt/c/Users/yourusername/Documents/. From there, compile your program using gcc with gcc Hello.c -o Hello.
answered Mar 23 at 15:01
Saul Kapruac
1263
1263
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
add a comment |Â
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
I finally figured it out and found the correct path. Thank you!
â Tony316
Mar 24 at 20:35
add a comment |Â
"saved it in documents."? But you're telling
gccthat it's in the current directory. What doesgcc Documents/Hello.c -o Helloproduce.â waltinator
Mar 23 at 14:13
I run it and this is what comes out: Tony316@DESKTOP-2ONG1CO:~$ gcc Documents/Hello.c -o Hello gcc: error: Documents/Hello.c: No such file or directory gcc: fatal error: no input files compilation terminated.
â Tony316
Mar 23 at 14:23