gcc: no input files [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash 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










share|improve this 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 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















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










share|improve this 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 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













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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • "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
















"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











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.






share|improve this answer




















  • I finally figured it out and found the correct path. Thank you!
    – Tony316
    Mar 24 at 20:35

















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.






share|improve this answer




















  • I finally figured it out and found the correct path. Thank you!
    – Tony316
    Mar 24 at 20:35














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.






share|improve this answer




















  • I finally figured it out and found the correct path. Thank you!
    – Tony316
    Mar 24 at 20:35












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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










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
















  • 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


Popular posts from this blog

Which professions warranted travel in Medieval times?

Trouble downloading packages list due to a “Hash sum mismatch” error

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?