Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have this main in a project in c++ but I can't compile it in gcc due to this error:

In file included from main.cpp:11:
../framework/application.h:8:10: fatal error: includes.h: El fitxer o directori no existeix
    8 | #include "includes.h"
      |          ^~~~~~~~~~~~

What it says is that the file "includes.h" doesn't exist. It exist but is in another directory and I don't know how to compile using a header from another directory.

I tried:

gcc -I ../framework/ main.cpp 
gcc -I../framework/ main.cpp
gcc -I "../framework/" main.cpp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
210 views
Welcome To Ask or Share your Answers For Others

1 Answer

Testing on my machine with a similar directory structure using the I directive worked for me. Ensure that your path is correct and I would even try using an absolute path as a test.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...