fatal error no such file or directory [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Hi i have a problem in linux terminal line. So i tried compiling a file to .o like this



gcc -c palindrome.c


and the error is



palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.


The file reverse.h indeed is in the directory because i copied everything from lab2 directory to lab 3. So why is it saying that? Thanks for the help



cscstuff@ubuntu:~/inlab2$ ls -l
total 32
-rwxrwxr-x 1 cscstuff cscstuff 8784 Oct 1 08:26 main1
-rw-rw-r-- 1 cscstuff cscstuff 338 Oct 1 08:20 main1.c
-rw-rw-r-- 1 cscstuff cscstuff 1888 Oct 1 08:24 main1.o
-rw-rw-r-- 1 cscstuff cscstuff 204 Oct 1 08:26 reverse.c
-rw-rw-r-- 1 cscstuff cscstuff 84 Oct 1 08:19 reverse.h
-rw-rw-r-- 1 cscstuff cscstuff 1472 Oct 1 08:26 reverse.o
cscstuff@ubuntu:~/inlab2$ cd
cscstuff@ubuntu:~$ cd inlab3
cscstuff@ubuntu:~/inlab3$ ls -l
total 16
drwxrwxr-x 2 cscstuff cscstuff 4096 Oct 1 08:33 inlab2
-rw-rw-r-- 1 cscstuff cscstuff 247 Oct 1 09:21 main2.c
-rw-rw-r-- 1 cscstuff cscstuff 297 Oct 15 11:01 palindrome.c
-rw-rw-r-- 1 cscstuff cscstuff 51 Oct 1 08:34 palindrome.h
cscstuff@ubuntu:~/inlab3$ gcc -c palindrome.c
palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.
cscstuff@ubuntu:~/inlab3$






share|improve this question














closed as unclear what you're asking by roaima, Stephen Rauch, Jeff Schaller, peterh, Anthon Oct 16 '17 at 2:30


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Which directory exactly are you in when you are run the gcc command? You appear to have a very confusing directory layout - with an inlab3 subdirectory inside ~/inlab2 - and both inlab2 and inlab3 subdirectories inside ~/inlab3
    – steeldriver
    Oct 15 '17 at 18:24










  • i am in lab3 when im running the command let me try deleting the extra lab3 sub directory inside lab3. also the lab3 directory is not suppose to be in lab2 directory. mistake on my part
    – Kat Mi
    Oct 15 '17 at 18:27










  • i updated my stuff so its less confusing but it still giving me the same errors
    – Kat Mi
    Oct 15 '17 at 18:39










  • What is your include line for the reverse.h in your c file?
    – Valentin B
    Oct 15 '17 at 18:43










  • it does not have an include line. Is that the problem?
    – Kat Mi
    Oct 15 '17 at 18:51














up vote
0
down vote

favorite












Hi i have a problem in linux terminal line. So i tried compiling a file to .o like this



gcc -c palindrome.c


and the error is



palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.


The file reverse.h indeed is in the directory because i copied everything from lab2 directory to lab 3. So why is it saying that? Thanks for the help



cscstuff@ubuntu:~/inlab2$ ls -l
total 32
-rwxrwxr-x 1 cscstuff cscstuff 8784 Oct 1 08:26 main1
-rw-rw-r-- 1 cscstuff cscstuff 338 Oct 1 08:20 main1.c
-rw-rw-r-- 1 cscstuff cscstuff 1888 Oct 1 08:24 main1.o
-rw-rw-r-- 1 cscstuff cscstuff 204 Oct 1 08:26 reverse.c
-rw-rw-r-- 1 cscstuff cscstuff 84 Oct 1 08:19 reverse.h
-rw-rw-r-- 1 cscstuff cscstuff 1472 Oct 1 08:26 reverse.o
cscstuff@ubuntu:~/inlab2$ cd
cscstuff@ubuntu:~$ cd inlab3
cscstuff@ubuntu:~/inlab3$ ls -l
total 16
drwxrwxr-x 2 cscstuff cscstuff 4096 Oct 1 08:33 inlab2
-rw-rw-r-- 1 cscstuff cscstuff 247 Oct 1 09:21 main2.c
-rw-rw-r-- 1 cscstuff cscstuff 297 Oct 15 11:01 palindrome.c
-rw-rw-r-- 1 cscstuff cscstuff 51 Oct 1 08:34 palindrome.h
cscstuff@ubuntu:~/inlab3$ gcc -c palindrome.c
palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.
cscstuff@ubuntu:~/inlab3$






share|improve this question














closed as unclear what you're asking by roaima, Stephen Rauch, Jeff Schaller, peterh, Anthon Oct 16 '17 at 2:30


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Which directory exactly are you in when you are run the gcc command? You appear to have a very confusing directory layout - with an inlab3 subdirectory inside ~/inlab2 - and both inlab2 and inlab3 subdirectories inside ~/inlab3
    – steeldriver
    Oct 15 '17 at 18:24










  • i am in lab3 when im running the command let me try deleting the extra lab3 sub directory inside lab3. also the lab3 directory is not suppose to be in lab2 directory. mistake on my part
    – Kat Mi
    Oct 15 '17 at 18:27










  • i updated my stuff so its less confusing but it still giving me the same errors
    – Kat Mi
    Oct 15 '17 at 18:39










  • What is your include line for the reverse.h in your c file?
    – Valentin B
    Oct 15 '17 at 18:43










  • it does not have an include line. Is that the problem?
    – Kat Mi
    Oct 15 '17 at 18:51












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Hi i have a problem in linux terminal line. So i tried compiling a file to .o like this



gcc -c palindrome.c


and the error is



palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.


The file reverse.h indeed is in the directory because i copied everything from lab2 directory to lab 3. So why is it saying that? Thanks for the help



cscstuff@ubuntu:~/inlab2$ ls -l
total 32
-rwxrwxr-x 1 cscstuff cscstuff 8784 Oct 1 08:26 main1
-rw-rw-r-- 1 cscstuff cscstuff 338 Oct 1 08:20 main1.c
-rw-rw-r-- 1 cscstuff cscstuff 1888 Oct 1 08:24 main1.o
-rw-rw-r-- 1 cscstuff cscstuff 204 Oct 1 08:26 reverse.c
-rw-rw-r-- 1 cscstuff cscstuff 84 Oct 1 08:19 reverse.h
-rw-rw-r-- 1 cscstuff cscstuff 1472 Oct 1 08:26 reverse.o
cscstuff@ubuntu:~/inlab2$ cd
cscstuff@ubuntu:~$ cd inlab3
cscstuff@ubuntu:~/inlab3$ ls -l
total 16
drwxrwxr-x 2 cscstuff cscstuff 4096 Oct 1 08:33 inlab2
-rw-rw-r-- 1 cscstuff cscstuff 247 Oct 1 09:21 main2.c
-rw-rw-r-- 1 cscstuff cscstuff 297 Oct 15 11:01 palindrome.c
-rw-rw-r-- 1 cscstuff cscstuff 51 Oct 1 08:34 palindrome.h
cscstuff@ubuntu:~/inlab3$ gcc -c palindrome.c
palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.
cscstuff@ubuntu:~/inlab3$






share|improve this question














Hi i have a problem in linux terminal line. So i tried compiling a file to .o like this



gcc -c palindrome.c


and the error is



palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.


The file reverse.h indeed is in the directory because i copied everything from lab2 directory to lab 3. So why is it saying that? Thanks for the help



cscstuff@ubuntu:~/inlab2$ ls -l
total 32
-rwxrwxr-x 1 cscstuff cscstuff 8784 Oct 1 08:26 main1
-rw-rw-r-- 1 cscstuff cscstuff 338 Oct 1 08:20 main1.c
-rw-rw-r-- 1 cscstuff cscstuff 1888 Oct 1 08:24 main1.o
-rw-rw-r-- 1 cscstuff cscstuff 204 Oct 1 08:26 reverse.c
-rw-rw-r-- 1 cscstuff cscstuff 84 Oct 1 08:19 reverse.h
-rw-rw-r-- 1 cscstuff cscstuff 1472 Oct 1 08:26 reverse.o
cscstuff@ubuntu:~/inlab2$ cd
cscstuff@ubuntu:~$ cd inlab3
cscstuff@ubuntu:~/inlab3$ ls -l
total 16
drwxrwxr-x 2 cscstuff cscstuff 4096 Oct 1 08:33 inlab2
-rw-rw-r-- 1 cscstuff cscstuff 247 Oct 1 09:21 main2.c
-rw-rw-r-- 1 cscstuff cscstuff 297 Oct 15 11:01 palindrome.c
-rw-rw-r-- 1 cscstuff cscstuff 51 Oct 1 08:34 palindrome.h
cscstuff@ubuntu:~/inlab3$ gcc -c palindrome.c
palindrome.c:2:21: fatal error: reverse.h: No such file or directory
compilation terminated.
cscstuff@ubuntu:~/inlab3$








share|improve this question













share|improve this question




share|improve this question








edited Oct 15 '17 at 18:59









Archemar

19.1k93366




19.1k93366










asked Oct 15 '17 at 18:15









Kat Mi

513




513




closed as unclear what you're asking by roaima, Stephen Rauch, Jeff Schaller, peterh, Anthon Oct 16 '17 at 2:30


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by roaima, Stephen Rauch, Jeff Schaller, peterh, Anthon Oct 16 '17 at 2:30


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • Which directory exactly are you in when you are run the gcc command? You appear to have a very confusing directory layout - with an inlab3 subdirectory inside ~/inlab2 - and both inlab2 and inlab3 subdirectories inside ~/inlab3
    – steeldriver
    Oct 15 '17 at 18:24










  • i am in lab3 when im running the command let me try deleting the extra lab3 sub directory inside lab3. also the lab3 directory is not suppose to be in lab2 directory. mistake on my part
    – Kat Mi
    Oct 15 '17 at 18:27










  • i updated my stuff so its less confusing but it still giving me the same errors
    – Kat Mi
    Oct 15 '17 at 18:39










  • What is your include line for the reverse.h in your c file?
    – Valentin B
    Oct 15 '17 at 18:43










  • it does not have an include line. Is that the problem?
    – Kat Mi
    Oct 15 '17 at 18:51
















  • Which directory exactly are you in when you are run the gcc command? You appear to have a very confusing directory layout - with an inlab3 subdirectory inside ~/inlab2 - and both inlab2 and inlab3 subdirectories inside ~/inlab3
    – steeldriver
    Oct 15 '17 at 18:24










  • i am in lab3 when im running the command let me try deleting the extra lab3 sub directory inside lab3. also the lab3 directory is not suppose to be in lab2 directory. mistake on my part
    – Kat Mi
    Oct 15 '17 at 18:27










  • i updated my stuff so its less confusing but it still giving me the same errors
    – Kat Mi
    Oct 15 '17 at 18:39










  • What is your include line for the reverse.h in your c file?
    – Valentin B
    Oct 15 '17 at 18:43










  • it does not have an include line. Is that the problem?
    – Kat Mi
    Oct 15 '17 at 18:51















Which directory exactly are you in when you are run the gcc command? You appear to have a very confusing directory layout - with an inlab3 subdirectory inside ~/inlab2 - and both inlab2 and inlab3 subdirectories inside ~/inlab3
– steeldriver
Oct 15 '17 at 18:24




Which directory exactly are you in when you are run the gcc command? You appear to have a very confusing directory layout - with an inlab3 subdirectory inside ~/inlab2 - and both inlab2 and inlab3 subdirectories inside ~/inlab3
– steeldriver
Oct 15 '17 at 18:24












i am in lab3 when im running the command let me try deleting the extra lab3 sub directory inside lab3. also the lab3 directory is not suppose to be in lab2 directory. mistake on my part
– Kat Mi
Oct 15 '17 at 18:27




i am in lab3 when im running the command let me try deleting the extra lab3 sub directory inside lab3. also the lab3 directory is not suppose to be in lab2 directory. mistake on my part
– Kat Mi
Oct 15 '17 at 18:27












i updated my stuff so its less confusing but it still giving me the same errors
– Kat Mi
Oct 15 '17 at 18:39




i updated my stuff so its less confusing but it still giving me the same errors
– Kat Mi
Oct 15 '17 at 18:39












What is your include line for the reverse.h in your c file?
– Valentin B
Oct 15 '17 at 18:43




What is your include line for the reverse.h in your c file?
– Valentin B
Oct 15 '17 at 18:43












it does not have an include line. Is that the problem?
– Kat Mi
Oct 15 '17 at 18:51




it does not have an include line. Is that the problem?
– Kat Mi
Oct 15 '17 at 18:51










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










From inlab3 either



  • add -I../inlab2 to compiler (e.g. gcc -I../inlab2 -c palindrome.c, this will tell gcc to look in ../inlab2 for the header file)


  • use #include "../inlab2/reverse.h" in include line (this will give relative path for the header file)


  • copy from inlab2 cp ../inlab2/reverse.h . (this will make a copy of the header file available in inlab3)






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    From inlab3 either



    • add -I../inlab2 to compiler (e.g. gcc -I../inlab2 -c palindrome.c, this will tell gcc to look in ../inlab2 for the header file)


    • use #include "../inlab2/reverse.h" in include line (this will give relative path for the header file)


    • copy from inlab2 cp ../inlab2/reverse.h . (this will make a copy of the header file available in inlab3)






    share|improve this answer


























      up vote
      1
      down vote



      accepted










      From inlab3 either



      • add -I../inlab2 to compiler (e.g. gcc -I../inlab2 -c palindrome.c, this will tell gcc to look in ../inlab2 for the header file)


      • use #include "../inlab2/reverse.h" in include line (this will give relative path for the header file)


      • copy from inlab2 cp ../inlab2/reverse.h . (this will make a copy of the header file available in inlab3)






      share|improve this answer
























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        From inlab3 either



        • add -I../inlab2 to compiler (e.g. gcc -I../inlab2 -c palindrome.c, this will tell gcc to look in ../inlab2 for the header file)


        • use #include "../inlab2/reverse.h" in include line (this will give relative path for the header file)


        • copy from inlab2 cp ../inlab2/reverse.h . (this will make a copy of the header file available in inlab3)






        share|improve this answer














        From inlab3 either



        • add -I../inlab2 to compiler (e.g. gcc -I../inlab2 -c palindrome.c, this will tell gcc to look in ../inlab2 for the header file)


        • use #include "../inlab2/reverse.h" in include line (this will give relative path for the header file)


        • copy from inlab2 cp ../inlab2/reverse.h . (this will make a copy of the header file available in inlab3)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 15 '17 at 19:07









        Kusalananda

        105k14209326




        105k14209326










        answered Oct 15 '17 at 19:03









        Archemar

        19.1k93366




        19.1k93366












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?