Eclipse Juno: Error 127

Discussion in 'Mac Programming' started by timebourne, Dec 8, 2012.

  1. timebourne, Dec 8, 2012
    Last edited: Dec 8, 2012

    macrumors member

    Joined:
    Sep 17, 2012
    #1
    I'm very close to throwing something at a wall right now. I've spent hours trying to get eclipse c/c++ to work on my computer. I have a mac that runs Snow Leopard, and I installed Eclipse Juno (I already have xCode, but I need to use eclipse for instructional purposes). So first, it kept telling me that gcc and g++ could not be found in PATH. So I went online and tried to find answers, and then I tried to resolve it using the .bash_profile file and other such ideas that took research and then trying multiple different inputs. Everyone seems to have their own little way to resolve it but it doesn't work specifically for me. I finally resolved it by reinstalled the CDT individually from the Juno package. That error stopped. Then I tried writing a simple hello world program given code here:
    Code:
    #include <iostream>
    using namespace std;
    
    int main () {
    	cout << "Hello world" << endl;
    	return 0;
    }
    
    So I know my syntax is right, I'm not using iostream.h or anything.
    It told me cout, std, etc could not be resolved.

    I found out that in the includes folder of the project it was missing a bunch of basic libraries that are needed. So I ended up going to project preferences, c/c++ general, paths and symbols, and in includes(with the folder icon) I added in the following files:
    Screen shot 2012-12-08 at 5.11.13 PM.png

    After closing and opening eclipse, the errors went away. So I cheered happily and tried to run it, and then it gave me the error: File was not launched. Binary not found. So then I went "wtf?" and I went back to google and found out that when you run it, it doesn't build first. So then I went to project -> build all. It built and then i tried to run it, and now I'm currently stuck here with no guidance from my research capabilities:
    Screen shot 2012-12-08 at 5.22.37 PM.png
    (oh and in case this means anything, no, I have not edited the makefile, I was just trying to check it out to see if it would maybe clue me into something...)

    If you want more information, I'm not very good with eclipse(and I know a good amount about c++(i've been working with it for a year or two now) but not at a highly technical level) so if you can, please include instructions on how to find this additional information, if not I can figure it out as well but I'm hard pressed for time.
    I'd greatly apreciate it if you could help me out, this is a huge headache and I can see a lot of people are suffering through this as well, so I think it would help a lot of people as well!
     
  2. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    http://stackoverflow.com/questions/3478877/eclipse-make-error-127

    That link suggests that Eclipse is having trouble finding something it needs. If you're using Xcode 4.3 or newer, you must manually install the command-line tools first. Older versions of Xcode come with the needed tools.

    The other problem you may be running into is that command names may have changed. Apple tends to refactor things in Xcode fairly frequently, and uses symbolic links in /usr/bin to point to the real name of the tools. Make sure you're referencing the symbolic links, rather than the real tools in the Developer folder.
     
  3. timebourne, Dec 9, 2012
    Last edited: Dec 9, 2012

    thread starter macrumors member

    Joined:
    Sep 17, 2012
    #3
    Hmm, yeah I went through that thread but the comments were things that didn't really apply, or I didn't understand.

    I have an older Xcode, Xcode 3. So if I understand correctly, my includes folders have the the real name of the tools, so I must find the libraries I need in /usr/bin and include THAT folder instead of the ones I currently have? (Here: Screen shot 2012-12-08 at 5.11.13 PM.png ) Or rather, do I have to edit the Symbols tab?
    (I apologize if I'm going in circles, I have a vague understanding of how this all works so I'm not entirely sure how everything correlates).
     
  4. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #4
    Yup. Your understanding is correct.

    EDIT: Well, the names of the compiler and linker you need live in /usr/bin. The libraries themselves may live in different places, but with Xcode 3 symbolic links to most of them are in /usr/include.
     
  5. thread starter macrumors member

    Joined:
    Sep 17, 2012
    #5
    Screen shot 2012-12-09 at 3.57.13 PM.png

    I added in /usr/bin and it still gave me the same message and /usr/include didn't exist so I went looking for something similar and I tried those and those didn't work. Hahaha this is kind of ridiculous.
     
  6. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #6
    Wow... well, shows you how different we are. Evidently you're still using Leopard, which I cannot even RUN on this Mac (it came with Snow Leopard). I am officially stumped.
     
  7. thread starter macrumors member

    Joined:
    Sep 17, 2012
    #7
    I'm for sure running Snow Leopard: Screen shot 2012-12-10 at 7.37.41 PM.png

    This is what my usr folder looks like:
    Screen shot 2012-12-10 at 7.40.43 PM.png
     

Share This Page