Question

I'm not familiar with eclipse. I have a question as this topic title. The scenario is that I want create a sub-folder "test" (for unit test) in folder src. But after the creation of folder "test", eclipse will automatically add this "test" folder and its content to current project. This leads to an error of multiple definition of "main" function because under "test" folder there is also a cpp file that contains main function. What I want is that put the "test" folder in src folder but this folder is not belong to current project, this means that when I compile current project the files under "test" won't be compiled (There is another test project do this). Anybody know? Thank you in advance!

Was it helpful?

Solution

By default Eclipse adds everything under the source folder as a source, but this can be changed in the project property settings. Right click on the project, select "properties", then make changes in the java build path to add an exclusion filter.

Add exclusion filter to source

Update:

To remove the folder from the project view, set a filter in the view menu: Filter files in the view

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top