How to include a file from another folder?

后端 未结 3 910
南笙
南笙 2021-01-31 19:35

In my current project I have separated my class files and my header files. My project structure currently looks like this:

  • Project

    • Source
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 19:39

    Assuming you want class1.cpp to include class1.h you would do something like this

    #include "../../Header/class1.h"
    

    The .. tells the tells the OS to jump 1 directory up when the compiler asks for the file.

提交回复
热议问题