Step 2− Install Eclipse C/C Development Tool (CDT) Two ways to install CDT, depending on whether you have previously installed an Eclipse: If you have already installed 'Eclipse for Java Developers' or other Eclipse packages, you could install the CDT plug-in as follows. The Eclipse 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. Get it as standalone Eclipse IDE for C/C Developers from. Skip to main content. Create account; Log in; Eclipse Plugins, Bundles and Products - Eclipse Marketplace.
- Related Questions & Answers
- Selected Reading
Step 1 − Install MinGW GCC or Cygwin GCC
To use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but has fewer features.
To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Open mysql in xampp. Download the latest version of the MinGW installation program which should be named MinGW <version>.exe.
While installing MinGW, at a minimum, you must install gcc-core, gcc-g++, binutils, and the MinGW runtime, but you may wish to install more.
Add the bin subdirectory of your MinGW installation to your PATH environment variable so that you can specify these tools on the command line by their simple names.
Step 2− Install Eclipse C/C++ Development Tool (CDT)
Two ways to install CDT, depending on whether you have previously installed an Eclipse:
If you have already installed 'Eclipse for Java Developers' or other Eclipse packages, you could install the CDT plug-in as follows:
Launch Eclipse → Help → Install New Software → In 'Work with' field, pull down the drop-down menu and select 'Kepler - http://download.eclipse.org/releases/kepler' (or juno for Eclipse 4.2; or helios for Eclipse 3.7).
In 'Name' box, expand 'Programming Language' node ⇒ Check 'C/C++ Development Tools' ⇒ 'Next' ⇒ .. ⇒ 'Finish'.
If you have not install any Eclipse package, you could download 'Eclipse IDE for C/C++ Developers' from http://www.eclipse.org/downloads, and unzip the downloaded file into a directory of your choice.
Add C++ To Eclipse
Step 3− Configuration
You do NOT need to do any configuration, as long as the Cygwin or MinGW binaries are included in the PATH environment variable. CDT searches the PATH to discover the C/C++ compilers.
Your eclipse is now ready to run C++. In order to test it, open Eclipse. Now choose File → New → Project → C/C++ project. In 'Toolchains' box, choose your compiler, e.g., 'Cygwin GCC' or 'MinGW GCC' ⇒ Next.
Eclipse C++ Setup
Create a new file and Write some C++ code in the file. Right-click the project and select Build Project. Finally, right-click the project and select run as and then Local C/C++ application. This should run your application.
If you face any difficulties in installing/running the project, please visit https://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseCpp_HowTo.html for much more detailed instructions.
This article describes how to setup Eclipse IDE for C/C++ Developers and OpenWrt SDK to build and debug programs running on LinkIt Smart 7688 development board.
After proper setup, Eclipse will be able to build, upload and attach debugger to your C/C++ program that runs on target LinkIt Smart 7688 development board. This can be pretty helpful if you are writing your own C/C++ programs.
- LinkIt Smart 7688 or LinkIt Smart 7688 Duo development platform.
- Mac OS X or Ubuntu Linuxmachine to run the OpenWrt SDK. If you haven't set it up yet, follow the cross compilation instructions to make sure the SDK is ready to use.
- Eclipse IDE for C/C++ Developers.
- Eclipse IDE requires JVM. Follow the IDE instructions to install the corresponding JVM version.
- Install and setup SFTP on LinkIt Smart 7688 development board with opkg.
- Install Eclipse C/C++ GCC Cross Compiler Support and Remote System explorer End-User Runtime. Newer versions of Eclipse may have these packages installed already.
- Create an Eclipse C/C++ Cross GCC project.
- Setup STAGING_DIR environment variable, tool command prefix, tool path and GDB tool path in the project settings.
- Build and setup sign-in password to LinkIt Smart 7688 development board.
- The IDE will automatically build, upload and execute the resulting binary.
Download and setup OpenWrt SDK
Follow the cross compilation guide to download and install the SDK first.
Enable SFTP on LinkIt Smart 7688 development board
First we need to prepare the board to enable the SFTP service. This allows Eclipse IDE to upload binaries and debug files to the board.
Make sure your board is connected to the internet and you have access to the system console. Enter following commands to install and enable the SFTP service.
Compiler C++ For Eclipse
Install and setup Eclipse IDE for C/C++ developers
Download the C/C++ package of the Eclipse IDE:
- Download and install Eclipse IDE for C/C++ Developers.
- Depending on your system, you may need to install JDK (not JRE) if the Eclipse IDE complains about incorrect JVM version.
Create and configure C project
Create a Hello World project that uses cross compilation toolchain from the LinkIt Smart 7688 OpenWrt SDK.
- Launch the IDE, click File, then New and then Project.
- In the New Project wizard, select C Project and click Next.
- Select Hello World ANSI C Project under Executables and Cross GCC from Toolchains, as shown below.
- If there is no Cross GCC option, install C/C++ GCC Cross Compiler Support.
- To install the Cross Compiler Support, Navigate to Help then Install new Software.., find C/C++ GCC Cross Compiler Support (org.eclipse.cdt.build.crossgcc) and install it.
- If there is no Cross GCC option, install C/C++ GCC Cross Compiler Support.
- Continue the steps in the wizard until you see the Cross GCC Command settings, as shown below:
- Click Finish and the wizard to create the project.
- Setup the STAGING_DIR environment variable required by OpenWrt SDK. From the menu click Project then Properties.
- Navigate to Environment under C/C++ Build. Here you can set additional environment variables required by the build system.
OpenWrt_SDK/staging_dir/where OpenWrt_SDK is the path to your OpenWrt SDK directory. An example setup is shown below:
Since the code is already generated by the wizard, proceed to build the project. Click Project then Build All from the main menu. If the setup is correct, you should see a build log similar to this:
If there are compiling or linking errors, check the settings in the previous steps.
Next, configure the IDE to upload the executable file automatically and debug with gdb remotely.
- Make sure your computer is in the same Wi-Fi network as LinkIt Smart 7688 development board. In this example you'll use the default domain name mylinkit.local. Make sure you can access the system console with SSH.
- Click Run then Debug Configurations.. from the main menu.
- In the dialog, select C/C++ Remote Application then click New.
- Click New.. connection, as shown below:
SetHost nameto mylinkit.local. Also set Default User Id to root.
- Define Remote Absolute File Path for C/C++ Application as /tmp/HelloWorld. You may also browse for another path.
Now select the Debug tab. Set the GDB Debugger path to
where OpenWrt_SDK is the path to the OpenWrt SDK.
- Click Apply then Debug. The IDE will now upload the built executable to LinkIt Smart 7688 development board through SFTP service. Enter the root password of the board, if the IDE prompts you to do so.
- The IDE now starts a gdbserver on the board, then connects Eclipse debug view to it. By default, it will break at the first line of the main() function.
You've now successfully built and debugged and application on Eclipse IDE with LinkIt Smart 7688 as a target device. You may use this reference application for further development.