Pages

Monday, September 19, 2011

Installing C/C++ plugin(or CDT) in Eclipse


Problem : Eclipse does not have C/C++ project by default.

Solution:
Install Eclipse CDT (C/C++ Development Tooling)from Synaptic Manager or Terminal

1)  Install the package eclipse-cdt
     sudo apt-get install eclipse-cdt

What is CDT ?
The CDT Project provides a fully functional C and C++ Integrated Development Environment based on the Eclipse platform. Features include: support for project creation and managed build for various toolchains, standard make build, source navigation, various source knowledge tools, such as type hierarchy, call graph, include browser, macro definition browser, code editor with syntax highlighting, folding and hyperlink navigation, source code refactoring and code generation, visual debugging tools, including memory, registers, and disassembly viewer

Refrences:
http://www.eclipse.org/cdt/

17 comments:

  1. hi, thx for the help, i had eclipse with java, for android dev. now i got the cdt part working. but i want to be able to choose a managed make file, and that is not an option. i just want to write a simple c++ program, but its not happening

    ReplyDelete
  2. Thank you for sharing this.
    I tried multiple times installing CDT via the software center with no luck.
    This worked like a charm.

    ReplyDelete
  3. Does cdt installed this way support debugging?If yes can you suggest a nice tut explaining or if no can you suggest how to implement

    ReplyDelete
    Replies
    1. I haven't done projects using CDT, so I don't have much idea about CDT's debugging support. I think this reference will surely help you.

      http://wiki.eclipse.org/CDT/User/FAQ#Debugging_C.2FC.2B.2B_Projects

      The above link shows that CDT has debugging support.

      Delete
  4. I've successfully done it. But when I tried to compile any C/C++ program in eclipse environment, it gives me error and says that binaries files are missing.
    So how to get binaries files? This is annoying me a lot. Although, I'm using ubuntu 12.04 LTS that comes with gcc and g++ 4.6 . But it is pretty boring to compile and run a .c/.cpp program through command line and also gedit can never compete with eclipse. So please help me figure out this problem!

    ReplyDelete
    Replies
    1. did you figure it out? I still trying to solve the issue myself.

      Delete
    2. Solution to problem for me. Go to Project>Properties>C/C++ Build>Binary Parse. In there check all options. That did the work for me.

      Delete
  5. For some reason, this is not working for me:

    ~$ sudo apt-get install eclipse-cdt
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package eclipse-cdt

    Any ideas?

    ReplyDelete
  6. I had the same problem "binaries files are missing"
    Just go to menu Project and select Clean...
    It solves the issue!

    ReplyDelete
  7. using UBUNTU 12-04.
    this ~$ sudo apt-get install eclipse-cdt does not work for me and takes hours try to fix it.
    Then, I directly download it from eclipse (select C/C++ for Linux developers) website, and it works for me. it takes a minute to solve this problem.

    ReplyDelete
    Replies
    1. ~$ sudo apt-get install eclipse-cdt works only if u have eclipse previously installed... if this is the first time you want to install eclipse and straight install it with cdt the you do
      ~$ sudo apt-get install eclipse eclipse-cdt

      Delete
    2. This saved my hours work ...thanks for sharing

      Delete
  8. Thanks for sharing your experience.

    ReplyDelete
  9. Tanks man now it's work ... knowledge is power!! :)

    ReplyDelete
  10. Thanks man now it's work, knowledge is power..!

    ReplyDelete