Author Topic: Can I automate my #include statements for .h files?  (Read 3036 times)

Offline Swiftslide

  • Single posting newcomer
  • *
  • Posts: 4
Can I automate my #include statements for .h files?
« on: August 23, 2010, 02:15:59 am »
Currently when I created a class, Code Blocks automatically places the .h and .cpp files in separate folders (~/include and ~/src respectively). However, the #include statement in the .cpp file only references classname.h, without specifying the path tot the ~/include folder. As I tend to create all my classes at once, it means I have to go into each one and update the statement.
Is there any way I can:

a) Have Code Blocks reflect its file organisation in its #include statements (preferably so that I don't have to set this option for every project)? OR
b) Automatically stop Code Blocks from putting my .h and .cpp files in separate folders, without having to alter the paths manually during class creation?

Any help would be appreciated. It's a minor point, but an annoyance all the same.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Can I automate my #include statements for .h files?
« Reply #1 on: August 23, 2010, 06:55:40 am »
Any help would be appreciated. It's a minor point, but an annoyance all the same.
Please STOP cross-posting.

It's the this post you create on the same topic. I've locked this thread therefore.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ