Code::Blocks, Unable to locate header file even though its in the same project

12,273
  1. Always use forward slashes in your #include directives. Backslashes only work on Windows.
  2. The layout of your Code::Blocks project has no effect on your C++ compiler. Go to Code::Blocks' project page and make sure that the folder in which include lies is in your include path. That setting should be in Project->Build Options->Search Directories->Compiler.
Share:
12,273
Eritey
Author by

Eritey

Updated on June 17, 2022

Comments

  • Eritey
    Eritey almost 2 years

    Having an issue where as I'm trying to link to a header file and the compiler cannot find it. I normally use VS for C++ development so I'm confused as to why this approach doesn't work in a similar fashion, unless I'm just doing it wrong.

    Image of the project including where the constants file is located. http://puu.sh/4oK3K.png

    Image of the debug window http://puu.sh/4oKJN.png

    Error text:

    C:\Users\Chris\Desktop\ECS-master\include\Components\Component.hpp|9|fatal error: include\Constants.hpp: No such file or directory| ||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|