Author Topic: #include statments don't point to the right directory  (Read 3774 times)

Offline Swiftslide

  • Single posting newcomer
  • *
  • Posts: 4
#include statments don't point to the right directory
« on: August 17, 2010, 05:31:22 am »
I'm letting Code Blocks manage my project sub-folders. With each new project it creates a src folder (for .cpp files) and an "include" folder (for .h files). The problem lies in creating a class: the cpp file's include statement specifies only the name of the .h file, even though the two files are in different folders. I have to edit each file to include the relative path. Is there any way to fix this, considering Code Blocks is causing it in the first place by putting the .h files and .cpp files in separate folders?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: #include statments don't point to the right directory
« Reply #1 on: August 17, 2010, 07:35:24 am »
yes, specify that include dir as an "include directory" in your project. Then the compiler will go look for the include files in that directory.