Search code examples
c++ceclipsebuildbuild-process

How to turn my project from multiple compilation unit into a single compilation unit in Eclipse


I have a "standard " project in eclipse with source and header files included. Although all the source files within the project are compiled, despite of the fact that these source files are not included by the main.c where is the main routine.

What I want is only one compilation unit (one source file to be compiled) and the other source files to be included #include "some-folder/some-file.c"directly. Not to be compiled separately as it is now.

I tried to remove the path to those files from the Build variables but they are still compiled individually.

Please guide me how to achieve what I want.


Solution

  • I'm not familiar with the C tools and, like others, don't know why you would do this but can you put the other source files in a separate folder that isn't marked as a source folder? The source files in the "non source" folder shouldn't be compiled automatically.