I encountered this same problem:
- I had a project directory called "demo1".
- I created a new workspace using that same "demo1" directory as the workspace root directory.
- When I went to import that project directory (which was the same as my root workspace directory), I got the "overlaps the workspace" error.
I'm using "Eclipse IDE for C/C++ Developers, Version: Indigo Service Release 2"
My solution:
- Exit Eclipse
- Delete the .metadata directory (this is created each time you start Eclipse) from inside my workspace directory ("demo1").
- Create a new directory called "demo1" within the existing "demo1" directory. So now I have "demo1/demo1".
- Move all the existing files and directories in my existing project, plus the .cproject and .project files (and the .settings directory if it exists), into that new "demo1" subdirectory.
- Restart Eclipse, and select the original "demo1" directory as my workspace.
- Go to File->Import, select "General" and "Existing projects into workspace". Click Next.
- Select the new "demo1" subdirectory as the project I wanted to import into my workspace.
- Make sure "Copy projects into workspace" is not checked.
- Click Finish, and it worked. Project builds.
FYI.
Eclipse creates a .metadata directory, a .cproject file, and a .project file (and sometimes a .settings directory). You need the .cproject and .project file, and the .settings directory if it exists. The .metadata directory is a temporary directory which Eclipse creates or updates each time it is opened. It can be deleted without any effect.