Eclipse "Nothing to Build for Project" Error on Build

28,145

Solution 1

The project would not build because it had the .cpp prefix, which implied a C++ file (in a C project). Everything worked when I changed it to .c.

Solution 2

In case of make error,go to project ->properties->c/c++ build->tool chain editor->select tools and select Cygwin C Compiler for C and Cygwin C++ Compiler for C++

Share:
28,145
Tchaikovsky
Author by

Tchaikovsky

Updated on August 27, 2020

Comments

  • Tchaikovsky
    Tchaikovsky almost 4 years

    I realize this has been asked before, on this site and others, but none have provided a satisfactory answer. I'm just starting out with C/C++ and I'm using the Eclipse CDT on Mac. After creating a C project, then creating a source file (with the proper .cpp suffix), and writing a simple "Hello World!" program, I get the following error in the console: "Nothing to build for project [name]". There is nothing wrong with the code, as far as I know.

    #include <stdio.h> 
    
    int main() {
        printf("Hello World");
    }
    

    I'm pretty sure there is nothing wrong with the gcc configuration or anything, although I am not entirely certain. The source file is saved and appears to be under the project, so I am not sure how to resolve this particular problem.

    Any help is appreciated.