Eclipse Build Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kid Programmer
    New Member
    • Mar 2008
    • 176

    Eclipse Build Error

    Hello. I have recently downloaded the Eclipse integrated development environment but when I tried to compile a simple Hello world project in the console window I get an error that says:

    "
    **** Build of configuration Debug for project HelloWorld! ****

    Nothing to build for project HelloWorld!"

    If it is something wrong with my code here is the code:
    Code:
    #include<iostream>
    using namespace std;
    
    int main() {
    	cout << "Hello, world!";
    	return 0;
    }
    How can I fix this? Thanks for the help.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    No it wouldn't be your code you have not inserted the file containing the code into the project. The IDE is complaining that there are no source files included in the project.

    Comment

    • Kid Programmer
      New Member
      • Mar 2008
      • 176

      #3
      Originally posted by Banfa
      No it wouldn't be your code you have not inserted the file containing the code into the project. The IDE is complaining that there are no source files included in the project.
      Thank you for replying but I don't understand why it can't find the file. I am positive the file exists. I saved it and then I found the folder and I opened the file.
      It opened up TextEdit (I'm using a mac) and it had the source code in it.

      Comment

      • Laharl
        Recognized Expert Contributor
        • Sep 2007
        • 849

        #4
        You have to use File->Import in Eclipse to bring the folder into a project for Eclipse to be able to run it. If you don't have a project, you'll need to make one.

        Comment

        • Kid Programmer
          New Member
          • Mar 2008
          • 176

          #5
          Originally posted by Laharl
          You have to use File->Import in Eclipse to bring the folder into a project for Eclipse to be able to run it. If you don't have a project, you'll need to make one.
          Okay thank you but I have one more problem. I really don't understand how to use eclipse to well and when I go to import I select my file and it also wants me to select a directory. None of my files are allowed to be imported for that part. What do I do.

          Comment

          • Laharl
            Recognized Expert Contributor
            • Sep 2007
            • 849

            #6
            When the import window pops up and you've picked File System, select the directory you want with Browse. The files in the directory should appear on the right side of the two large boxes. Select the ones you want to import. Then pick which project you want to import to with the 'into folder' dialog box. If nothing appears there, you'll need to cancel out and create a project first.

            My advice is admittedly coming from the Linux version of Eclipse, but there shouldn't be much difference.

            Comment

            Working...