Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Separate folders for .h and .cpp files?(How can I create separate folders for .h and .cpp files?)
Separate folders for .h and .cpp files? [message #1105811] Tue, 10 September 2013 05:53 Go to next message
Anders Tangedal Nordeide is currently offline Anders Tangedal Nordeide
Messages: 3
Registered: September 2013
Junior Member
Hi

I was trying to separate my header files from my (cpp) implementation bye storing them in two different source folders however eclipse then tells the compiler to look for the xxx.h file in the same folder as the xxx.cpp (or the other way around, I can't remember ATM) file which causes the compiler to stop as it can't find the specified file. Is there any way to create such folders in Eclipse and get around this issue. The folders don't need to be created in the actual filesystem. Just in the view so it becomes a bit more manageable on larger projects.

I do bye the way realize that i can achieve this sort of effect with a make file, but i hardly have any experience using make and as such I would like the IDE to handle compiler input.

Thank you in advance for any feedback Wink
Re: Separate folders for .h and .cpp files? [message #1105959 is a reply to message #1105811] Tue, 10 September 2013 09:52 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1336
Registered: July 2009
Senior Member
This should work if you mark the include folder as a C++ source folder. Right click include folder and select Use as Source folder (or something similar) from context menu.
Re: Separate folders for .h and .cpp files? [message #1106489 is a reply to message #1105959] Wed, 11 September 2013 02:51 Go to previous message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
There is also a preference option to sort the headers files before the source files in the Project Explorer
Windows->Preferences->C/C++->Appearance


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Integrated debugger
Next Topic:Linker Errors in Hello World program
Goto Forum:
  


Current Time: Thu Aug 21 20:16:45 EDT 2014

Powered by FUDForum. Page generated in 0.01670 seconds