Compile C in eclipse

This is a discussion on Compile C in eclipse within the C Programming forums, part of the General Programming Boards category; Im trying to compile C in eclipse (windows). I installed CDT, MinGW and set PATH with C:\MinGW\bin, but when compiling ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    4

    Compile C in eclipse

    Im trying to compile C in eclipse (windows).
    I installed CDT, MinGW and set PATH with C:\MinGW\bin, but when compiling an ordinary Hello World, eclipse returns "failed no binaries found".
    What im doing wrong?

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    I've tried using Eclipse with little success. Did you get the C/C++ plugin? That will get you started.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,045
    Did you restart? Depending on your version of Windows, you may need to restart Windows or at least Eclipse before the changes to the path take effect.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    4
    Yes, i installed CDT plugin and i restarted after changes in PATH, but it did not work.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If you start a new command prompt, and try to compile it from the source directory by hand, does that work?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Nub SWE
    Join Date
    Mar 2008
    Location
    Dallas, TX
    Posts
    133
    I use Eclipse extensively. The main problem I had with it originally was that I didn't have the Java RTE, I believe. Once you grab the piece of Java that Eclipse needs, this might clear up the problem for you.

    Eclipse is great once you get it working. It has one of the best debuggers I've ever worked with.

  7. #7
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Hi JDGATX!
    I will also like to use Eclipse for C/C++ development. Currently I use Crimson Editor and MinGW command line tools.
    I am running WinXP. Would you give me some advice how to start using Eclipse?

  8. #8
    Nub SWE
    Join Date
    Mar 2008
    Location
    Dallas, TX
    Posts
    133
    Well, here at work, we've got this huge directory of installs and things. Eclipse was available to me here from the start. I don't do a huge amount of programming at home, so I've never had to hunt down the install from anywhere else. I assume (since I believe it is open source) that you should be able to find a copy of the install somewhere. The zip I have here on my machine is eclipse_win32_setup.zip. Install that.

    Then you have to make sure you grab the Java JDK. Again, I am not entirely sure where to find that, but a quick google should bring up the latest version.

    My includes are listed as:
    C:/Program Files/mingw/include and C:/Program Files/mingw/lib/gcc/mingw32/3.4.5/include

    Here are the relevant parts of my PATH:
    C:\Program Files\mingw\bin;C:\Program Files\Java\jre1.5.0_09\bin\client;C:\Program Files\Java\jre1.5.0_09\bin

    Not sure if I've been any help, but I can try to dig around in my settings if you guys have any more questions.

  9. #9
    Nub SWE
    Join Date
    Mar 2008
    Location
    Dallas, TX
    Posts
    133
    Quote Originally Posted by leopupo View Post
    Im trying to compile C in eclipse (windows).
    I installed CDT, MinGW and set PATH with C:\MinGW\bin, but when compiling an ordinary Hello World, eclipse returns "failed no binaries found".
    What im doing wrong?
    The only time I've gotten that error is when I'm trying to RUN something that I haven't built yet. My usual routine is to set the workspace directory, create a new project, create a new source file, write the code. Then you can either right click on the project and do a "Build Project" or you can go up to Project->Build All.

    That probably has nothing to do with the error you're getting, but like I said, I've never seen that error outside of trying to RUN without BUILDing first.

  10. #10
    Registered User
    Join Date
    Mar 2008
    Posts
    4
    I've build it, but it still not works

  11. #11
    Nub SWE
    Join Date
    Mar 2008
    Location
    Dallas, TX
    Posts
    133
    Quote Originally Posted by leopupo View Post
    I've build it, but it still not works

    From http://forums.fedoraforum.org/forum/...clipse+plugins:
    Anyway, "no binaries" eh? You're using Eclipse, right? Well did you try to just Run or Debug the program without Compiling and Linking first? (note: sometimes IDEs like Eclipse have a Build command that means Link) Basically you have source code, but haven't translated it into machine code (what the computer understands). If you need more explanation of compiling and linking just ask.
    As I said in the previous post, compile and link (might be called "build" in Eclipse), before running or debugging.

    What happens is:
    You write source code
    A compiler translates your source code into machine code that your CPU can understand
    A linker then brings in other pre-made machine code that your program requires
    You now have an executable binary, this is what you run
    Everything I try to search matching your error message tells me what I've already told you.

    Be sure to save the file.

    Then do a build all.

    Then debug or run.

    If you have the CDT, the JDK, MinGW, and Eclipse installed, if you have your project created, and you actually build the thing before running or debugging, AND you're still getting the error, I'm afraid I, and the rest of the internet, have no further ideas for you. Sorry.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 12:36 PM
  2. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 07:20 AM
  3. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 08:05 PM
  4. Eclipse - Palm - undefined reference to - Cygwin
    By gustavolaufer in forum C++ Programming
    Replies: 0
    Last Post: 03-02-2006, 06:33 AM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 01:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21