Skip to main content

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 09:53 Go to next message
Anders Tangedal Nordeide is currently offline Anders Tangedal NordeideFriend
Messages: 3
Registered: September 2013
Junior Member

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 13:52 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1409
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 06:51 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
There is also a preference option to sort the headers files before the source files in the Project Explorer

Before you ask
- search this forum
- see the FAQ
- google
Previous Topic:Integrated debugger
Next Topic:Linker Errors in Hello World program
Goto Forum:

Current Time: Tue Jun 19 21:49:26 GMT 2018

Powered by FUDForum. Page generated in 0.02259 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top