Install ECLIPSE+CDT under Mac

Source: Internet
Author: User

Test file Test.cpp

#include <iostream>
using namespace Std;

int main () {
cout << "!!! Hello World!!! "<< Endl; Prints!!! Hello World!!!
return 0;
}

1. Install the C + + compilation environment and ensure that the g++ Test.cpp is entered at the command line to generate the binary files correctly

I. Install Xcode, AppStore can be down to. At this time g++ can be used, but iostream,stdio.h and other files are not, because the relevant command line tool is not installed complete (PIT Dad!! )!

Ii. Installing the complete g++ command-line tool

Xcode->open developer tool-> more developer tools ...

This will jump to the Apple website and download the latest version of command line Tools (OS X XXXXX) for Xcode, install

OS X name, on the Apple->about this Mac can find the OS version number, and then according to the version number to google its name, we 10.9.3 called Mavericks)

After the installation is complete, a variety of familiar header files such as stdio.h and a directory C + + will appear under/usr/include

At this time the command line execution g++ test.cpp, all errors disappear, finally can be successfully compiled

2. Install eclipse, download the website

3. Install the CDT:

In Eclipse->help->install New softerware.

Enter the CDT download Url,http://download.eclipse.org/tools/cdt/releases/juno in the top URL,

The CDT Main Features and CDT Optional Features appear, open, select the items you want to install, install

Restart the eclips, C + + Project appears under File->new->, CDT installation is complete

4. Setting the CDT

Under Eclipse, project->properties->c/c++ general->paths and Symbols

GNU C is set to/usr/include

GNU C + + is set to/usr/include/c++/version number

5 Restart Eclips, create a new C + + project, add the above test files, Build,run, done!

Install ECLIPSE+CDT under Mac

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.