<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html> | |
<head> | |
<title>Configuring the NetBeans IDE for C/C++/Fortran - NetBeans IDE 6.8</title> | |
<meta name="DESCRIPTION" content="Configuring the NetBeans IDE for C/C++/Fortran - NetBeans IDE 6.8"> | |
<link rel="stylesheet" type="text/css" href="../../../netbeans.css"> | |
</head> | |
<body> | |
<a name="top"></a> | |
<h1>Configuring the NetBeans IDE for C/C++/Fortran</h1> | |
<!-- START INTRO ---------------------------------------------------------------------------------------* --> | |
<div class="articledate" style="margin-left: 0px;font-style:italic;"> | |
February 2010</em> [Revision number: V6.8-3]</div> | |
<p>This document provides | |
information about downloading, installing, and configuring C/C++ support in the | |
NetBeans IDE. Before you can develop in C/C++, the NetBeans IDE requires the | |
C/C++ plugin module, and third party C/C++ compilers, <code>make</code> utilities, and | |
debuggers. | |
</p> | |
<!-- END INTRO --> | |
<h3>Contents</h3> | |
<img src="../../../images_www/articles/68/netbeans-stamp.gif" class="stamp" | |
alt="Content on this page applies to NetBeans IDE 6.8" | |
title="Content on this page applies to the NetBeans IDE 6.8"> | |
<ul class="toc"> | |
<li><a href="#downloading" title="Enabling C/C++/Fortran in the IDE"> | |
Enabling C/C++/Fortran in the IDE</a></li> | |
<li><a href="#compilers" title="Installing and Setting Up the Compilers and Tools">Installing and Setting Up the Compilers and Tools</a></li> | |
<li><a href="#verifying" title="Verifying the Installation">Verifying the | |
Installation</a></li> | |
</ul> | |
<p><b>To follow this tutorial, you need the following software and resources.</b></p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Required</th> | |
</tr> | |
<tr> | |
<td class="tbltd1">NetBeans IDE</td> | |
<td class="tbltd1"><a | |
href="https://netbeans.org/downloads/6.8/index.html">version 6.8 with NetBeans C/C++ plugin</a></td> | |
</tr> | |
<tr> | |
<td class="tbltd1">Java Developer Kit (JDK)</td> | |
<td class="tbltd1"><a href="http://java.sun.com/javase/downloads/index.jsp">version 6</a> or | |
version 5</td> | |
</tr> | |
</tbody> | |
</table> | |
<br> | |
<!-- DOWNLOADING ----------------------------------------------------------> | |
<h2><a name="downloading">Enabling C/C++/Fortran in the IDE</a></h2> | |
<p> | |
The NetBeans IDE is a dynamic modular IDE, which means you can change it by | |
adding and removing modules of the program. You can add functionality by | |
installing plugin modules, or remove functionality by uninstalling plugin modules. | |
See the NetBeans IDE online help for more information about plugins.</p> | |
<p> | |
If you want to work with C, C++, or Fortran programs in the NetBeans IDE, | |
your NetBeans installation must include the C/C++ plugin.</p> | |
<p class="tips">Although the plugin is named C/C++, it also includes support for Fortran | |
programming.</p> | |
<h3>If you have not yet installed NetBeans IDE 6.8</h3> | |
<p>If you have not yet | |
installed the NetBeans IDE, download either the <b>C/C++</b> bundle or the | |
<b>All</b> bundle from <a href="https://netbeans.org/downloads/6.8/index.html">NetBeans IDE | |
6.8 Download Page</a>. If you will not be using other languages such as Java and Ruby, | |
you should download the C/C++ bundle.</p> | |
<h3>If you have NetBeans IDE 6.8 but do not know if you have the C/C++ plugin</h3> | |
<p>If you already have NetBeans IDE, determine if your NetBeans IDE includes the | |
C/C++ plugin already, by selecting File > New Project. | |
If C/C++ is listed as one of the Categories, you have the C/C++ plugin module. | |
You should skip to the section <a href="#compilers">Installing and Setting Up the Compilers and Tools</a>. | |
</p> | |
<h3>If you have NetBeans IDE 6.8 without the C/C++ plugin</h3> | |
<p>If your NetBeans IDE does not show a C/C++ project category when you select | |
File > New Project, complete the | |
following steps to add the C/C++ plugin module to the IDE.</p> | |
<ol> | |
<li>If your network uses a proxy, choose Tools > Options > General in the IDE, | |
select Manual Proxy Settings, enter the HTTP Proxy and Port for | |
your proxy, and click OK.</li> | |
<li>Choose Tools > Plugins.</li> | |
<li>In the Plugins dialog box, click the Available Plugins tab, | |
and scroll to the C/C++ category. | |
</li> | |
<li>Select the C/C++ checkbox and click Install to start the NetBeans IDE Installer.</li> | |
<li>In the NetBeans IDE Installer, click Next.</li> | |
<li>Read the license agreement, select the checkbox to accept the terms | |
of the license agreement, and click Next.</li> | |
<li>Click Install.</li> | |
<li>After the installation completes, select either Restart IDE Now or Restart | |
IDE Later and click Finish.</li> | |
</ol> | |
<!-- COMPILER SETUP -------------------------------------------------------> | |
<h2><a name="compilers">Installing and Setting Up the Compilers and Tools</a></h2> | |
<p>The Netbeans C/C++ module requires a C compiler, C++ compiler, | |
<tt>make</tt> utility, and <tt>gdb</tt> debugger. See the following instructions for | |
the platform of your development system. | |
</p> | |
<table> | |
<tr> | |
<td>- </td> | |
<td><a href="#compilers_windows" title="Windows Platform">Windows</a></td> | |
</tr> | |
<tr> | |
<td>- </td> | |
<td><a href="#compilers_solaris" title="Solaris Platform">Solaris OS</a></td> | |
</tr> | |
<tr> | |
<td>- </td> | |
<td><a href="#compilers_opensolaris" title="OpenSolaris Platform">OpenSolaris OS</a></td> | |
</tr> | |
<tr> | |
<td>- </td> | |
<td><a href="#compilers_linux" title="Linux Platforms">Linux</a> | |
</td> | |
</tr> | |
<tr> | |
<td>- </td> | |
<td><a href="#compilers_mac" title="Macintosh OS X">Macintosh OS X</a> | |
</td> | |
</tr> | |
</table> | |
<!-- COMPILER SETUP: WINDOWS ----------------------------------------------> | |
<!--<blockquote>--> | |
<h3><a name="compilers_windows"></a>Windows</h3> | |
<p>The NetBeans C/C++ module has been tested with compilers from Cygwin and | |
MinGW. You should install either Cygwin or MinGW compilers, but not both.</p> | |
<p class="notes">If you want to use Qt with Windows, you must install MinGW.</p> | |
<table class="b-none" cellpadding="0" cellspacing="0" class="vatop"> | |
<tr> | |
<td>- </td> | |
<td><a href="#cygwin" title="Cygwin Compilers and Tools" target="_blank">Cygwin Compilers and Tools</a></td> | |
</tr> | |
<tr> | |
<td>- </td> | |
<td><a href="#mingw" title="MinGW Compilers and Tools" target="_blank">MinGW Compilers and Tools</a></td> | |
</tr> | |
</table> | |
<h4><a name="cygwin"></a>Cygwin Compilers and Tools</h4> | |
<p>The NetBeans C/C++ module has been tested with the following compilers | |
and tools from <a href="http://cygwin.com" target="_blank">Cygwin.com</a>.</p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Tested</th> | |
<th class="tblheader" scope="col">Description</th> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>cygwin1.dll</tt></td> | |
<td class="tbltd1">1.5.21</td> | |
<td class="tbltd1">Cygwin Linux-like environment for Windows</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gcc</tt></td> | |
<td class="tbltd1">3.4.4</td> | |
<td class="tbltd1">Cygwin C compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>g++</tt></td> | |
<td class="tbltd1">3.4.4</td> | |
<td class="tbltd1">Cygwin C++ compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gdb</tt></td> | |
<td class="tbltd1">6.8</td> | |
<td class="tbltd1">Cygwin GNU debugger</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>make</tt></td> | |
<td class="tbltd1">3.81</td> | |
<td class="tbltd1">Cygwin make utility</td> | |
</tr> | |
</tbody> | |
</table> | |
<br> | |
<p>If you already have the Cygwin gcc and g++ compilers, GNU <tt>make</tt>, and | |
<tt>gdb</tt> debugger installed on your Windows system and | |
your path is set up correctly to find them, make sure that you have the | |
correct versions. | |
</p> | |
<p><b>To check the versions of your Cygwin compilers and tools:</b></p> | |
<ol> | |
<li> | |
<p>Check the version of Cygwin environment by typing the following commands at a Windows command prompt:</p> | |
<pre class="examplecode"> | |
C:\> cygcheck -c cygwin | |
</pre> | |
</li> | |
<li>Check the versions of the Cygwin gcc and g++ compilers, <tt>make</tt>, and <tt>gdb</tt> by | |
typing the following commands at a Windows command prompt: | |
<pre class="examplecode"> | |
C:\> gcc --version | |
C:\> g++ --version | |
C:\> make --version | |
C:\> gdb --version | |
</pre> | |
</li> | |
</ol> | |
<p>If you have the correct versions, then no further setup is | |
necessary. See <a href="#verifying">Verifying the Installation</a> to verify that | |
the tools are installed correctly for the NetBeans IDE.</p> | |
<p><b>To install the GNU gcc and g++ compilers, <tt>make</tt>, and <tt>gdb</tt> debugger from | |
<a href="http://cygwin.com" target="blank">cygwin.com</a>:</b></p> | |
<ol> | |
<li>Download the Cygwin <tt>setup.exe</tt> program by clicking the Install or Update Now! | |
icon in the middle of the page, or by clicking this direct | |
<a href="http://www.cygwin.com/setup.exe"> | |
<tt>setup.exe</tt></a> link. | |
</li> | |
<li> | |
Run the <tt>setup.exe</tt> program. Accept the defaults until you reach | |
the Select Your Internet Connection page. Select the option on this | |
page that is best for you. Click Next. | |
</li> | |
<li> | |
On the Choose Download Site page, choose a download site you think | |
might be relatively close to you. Click Next. | |
</li> | |
<li> | |
On the Select Packages page you select the packages to download. Click | |
the + next to Devel to expand the development tools category. You may | |
want to resize the window so you can see more of it at one time. | |
</li> | |
<li> | |
Select each package you want to download by clicking the Skip label | |
next to it, which reveals the version number of the package to download. | |
At a minimum, select gcc-core: C compiler, | |
gcc-g++: C++ compiler, gdb: The GNU Debugger, and make: the GNU | |
version of the 'make' utility. Packages that are required by the packages you | |
select are automatically selected as well. | |
</li> | |
<li>Click Next to connect to the download site and download the packages you | |
selected, and click Finish when the installation is complete.</li> | |
<li> | |
Now add the Cygwin compiler directory to your path to enable NetBeans IDE | |
to find the tools collection: | |
<br><br> | |
<ol type="a"> | |
<li>Open the Control Panel (Start > Settings > Control Panel) and | |
double-click System.</li> | |
<li>Select the Advanced tab and click Environment Variables.</li> | |
<li>In the System Variables panel of the Environment Variables dialog, | |
select the <tt>Path</tt> variable and | |
click Edit.</li> | |
<li>Add the path to the | |
<tt><i>cygwin-directory</i>\bin</tt> directory to the <tt>Path</tt> variable, and | |
click OK. By default, <tt><i>cygwin-directory</i></tt> is | |
<tt>C:\cygwin</tt>. Directory names must be separated with a semicolon. | |
Your edited path should look something like | |
<tt>%SystemRoot%\system32;%SystemRoot%;C:\Program Files\QuickTime\QTSystem;C:\cygwin\bin</tt></li> | |
<li>Click OK in the Environment Variables dialog and the System | |
Properties dialog. | |
</li> | |
<li>See <a href="#verifying">Verifying the Installation</a> to verify that the tools were installed correctly | |
for the NetBeans IDE.</li> | |
</ol> | |
</li> | |
</ol> | |
<!-- MinGW installation --> | |
<h4><a name="mingw"></a>MinGW Compilers and Tools</h4> | |
<p>NetBeans IDE 6.8 was tested with Minimalist GNU for Windows (MinGW) and the Minimal System (MSYS) | |
Unix-like environment. Versions tested and installation instructions are shown below.</p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Tested</th> | |
<th class="tblheader" scope="col">Description</th> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gcc</tt></td> | |
<td class="tbltd1">3.4.5</td> | |
<td class="tbltd1">MinGW C compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>g++</tt></td> | |
<td class="tbltd1">3.4.5</td> | |
<td class="tbltd1">MinGW C++ compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gdb</tt></td> | |
<td class="tbltd1">6.8</td> | |
<td class="tbltd1">MinGW GNU debugger</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>make</tt></td> | |
<td class="tbltd1">3.79.1</td> | |
<td class="tbltd1">MSYS <tt>make</tt> utility<br> | |
Note that MinGW make is not supported</td> | |
</tr> | |
</tbody> | |
</table> | |
<br> | |
<p><b>To install the GNU compilers, <tt>make</tt>, and <tt>gdb</tt> debugger from | |
<a href="http://mingw.org" target="_blank">mingw.org</a>:</b></p> | |
<ol> | |
<li>Log in to Windows using an account with "computer administrator" privileges. | |
</li> | |
<li>Download the self-extracting installer from | |
<a href="http://mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite" target="_blank"> | |
How To Install the MinGW (GCC) Compiler Suite</a> on mingw.org or for convenience you | |
can download from this | |
<a href="http://sourceforge.net/project/downloading.php?group_id=2435&filename=MinGW-5.1.4.exe&a=57946486">direct link to MinGW-5.1.4.exe</a>. | |
</li> | |
<li>Run the MinGW-5.1.4.exe installer in Windows.</li> | |
<li>In the MinGW installer, accept the defaults until you get to the Choose Components page.</li> | |
<li>On the Choose Components page, select the g++ compiler. The gcc compiler is automatically | |
included in the installation so it is not a selectable component.</li> | |
<li>Do not select MinGW make, as you need to use the make from MSYS instead, | |
which is downloaded separately. Click Next.</li> | |
<li>Use the default <tt>C:\MinGW</tt> as the destination folder if possible to minimize any potential difficulty with using | |
the compilers from another location.</li> | |
<li>Click Install to install the MinGW tools, then click Next, then click Finish.</li> | |
<li>Add the <tt>C:\MinGW\bin</tt> directory to your path, as described in | |
<a href="http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_suite#toc7" target="_blank">Environment Settings</a> | |
in the MinGW wiki.</li> | |
<li>See the installation instructions for MSYS at the <a href="http://www.mingw.org/wiki/MSYS" target="_blank">MinGW MSYS wiki</a>. | |
You only need to install the MSYS 1.0 files. You do not need to install the DTK or the core files mentioned in the wiki page.</li> | |
<li>For convenience, you can download from this | |
<a href="http://downloads.sourceforge.net/mingw/MSYS-1.0.10.exe">direct link to MSYS-1.0.10.exe</a> </li> | |
<li>Make sure you are using a Windows account with "computer administrator" privileges when you | |
install MSYS. The NetBeans IDE might have issues when you try to build and run projects later if MSYS | |
is installed under a limited user account.</li> | |
<li>Run the MSYS-1.0.10.exe installer and accept the defaults.</li> | |
<li>To install the gdb debugger, download from this | |
<a href="http://sourceforge.net/project/downloading.php?group_id=2435&filename=gdb-6.8-mingw-3.tar.bz2&a=66334146"> | |
direct link to gdb-6.8-mingw-3.tar.bz2</a>. You must have a Windows zip utility such | |
as gzip, 7-zip, or WinZip to extract this gdb archive.</li> | |
<li>Unzip the gdb-6.8-mingw-3.tar.bz2 to your <tt>C:\MinGW</tt> directory so that the gdb | |
executable is installed into your <tt>C:\MinGW\bin</tt> directory.</li> | |
<li>See <a href="#verifying">Verifying the Installation</a> to verify that the tools were installed correctly | |
for the NetBeans IDE.</li> | |
</ol> | |
<br> | |
<!-- COMPILER SETUP: SOLARIS OS --------------------------------> | |
<h3><a name="compilers_solaris"></a>Solaris OS</h3> | |
<p> | |
On the Solaris OS, you can use GNU tools or Sun Studio tools. The GNU | |
tools are included in Solaris 10 OS in the /usr/sfw/bin directory by default. | |
The Sun Studio software is a suite of developers tools that are free to download. | |
The Sun Studio compilers are optimized for Sun hardware, and make it | |
easier to produce performance tuned Solaris binaries.</p> | |
<p style="tips">If you are using OpenSolaris, see <a href="#compilers_opensolaris">OpenSolaris OS</a>. | |
</p> | |
<p> | |
NetBeans IDE 6.8 has been tested with the following compilers | |
and tools.</p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Tested</th> | |
<th class="tblheader" scope="col">Description</th> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>cc</tt></td> | |
<td class="tbltd1">5.9 and 5.10</td> | |
<td class="tbltd1">Sun Studio 12 C compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>CC</tt></td> | |
<td class="tbltd1">5.9 and 5.10</td> | |
<td class="tbltd1">Sun Studio 12 C++ compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gcc</tt></td> | |
<td class="tbltd1">3.4.3</td> | |
<td class="tbltd1">GNU C compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>g++</tt></td> | |
<td class="tbltd1">3.4.3</td> | |
<td class="tbltd1">GNU C++ compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gdb</tt></td> | |
<td class="tbltd1">6.6 and 6.8</td> | |
<td class="tbltd1">GNU debugger</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gmake</tt></td> | |
<td class="tbltd1">3.81</td> | |
<td class="tbltd1">GNU make</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>make</tt></td> | |
<td class="tbltd1">3.81</td> | |
<td class="tbltd1">Solaris make</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>dmake</tt></td> | |
<td class="tbltd1">7.8 and 7.9</td> | |
<td class="tbltd1">Sun Studio 12 distributed make utility</td> | |
</tr> | |
</tbody> | |
</table> | |
<h4>Sun Studio 12 Compilers</h4> | |
<p>If you want to use the Sun Studio 12 compilers in Solaris 10 OS:</p> | |
<ul> | |
<li>If you | |
have Sun Studio 12 software installed, ensure that <tt>/<i>installation | |
directory</i>/SUNWspro/bin</tt> | |
is in your path before you start the NetBeans IDE. The default location on | |
Solaris 10 OS is <tt>/opt/SUNWspro/bin</tt></li> | |
<li> | |
If you do not have Sun Studio 12 software installed, you can | |
download it free at <a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/ss12-136026.html" target="_blank"> | |
<tt>http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/ss12-136026.html</tt></a>. | |
</li> | |
</ul> | |
<p><b>To download and install the Sun Studio 12 compilers:</b></p> | |
<ol> | |
<li>Create a directory for the downloaded file. | |
You must have write permission for this directory.</li> | |
<li> | |
Download the file for your platform into the download directory. | |
</li> | |
<li>Go to the download directory, and uncompress and untar the downloaded file. | |
<pre> | |
bzcat <i>filename</i> | tar xvf - | |
</pre> | |
</li> | |
<!-- | |
<li> | |
Become superuser (root). Run the installer in the download directory by typing: | |
<pre> | |
./installer | |
</pre> | |
</li> | |
<br> | |
<li>Click Next on the Welcome page, and accept the Software License Agreement | |
and click Next. | |
</li> | |
<li>On the Select Components page of the installer, select Custom Install for | |
Sun Studio Software. Select Default Install for Solaris Patches. Select No Install for | |
Documentation, Source Distribution, and Sun Performance Library. | |
</li> | |
<li>On the Select Install Directory page, if you want to install the compilers | |
in the default installation directory <tt>/opt</tt>, click Next. If you want to | |
install the compilers in a different directory, type the path in the text field | |
and click Next.</li> | |
<li>On the Select Subcomponents page, select Compilers C and | |
Compilers C++, and click Next. | |
</li> | |
<li>On the Ready to Install page, verify that the disk space shown is available | |
on your system, and that the C compiler, C++ compiler, and Solaris patches are | |
listed. Then click Install Now. | |
</li> | |
<li>When installation is complete, proceed through the Installation Summary | |
page, the Registration page, and the After Installation page, and click Exit to | |
exit the installer. | |
</li> | |
--> | |
<li>Follow the instructions in <a | |
href="http://www.oracle.com/technetwork/indexes/documentation/index.html" target="_blank">Chapter 2 of the <i>Sun | |
Studio 12 Quick Installation (English, Japanese, Simplified Chinese)</i> | |
guide</a> to install the C compiler, C++ compiler, | |
and required Solaris patches.</li> | |
<li>Edit your <tt>PATH</tt> to add the path to the Sun Studio software before | |
starting the NetBeans IDE.</li> | |
<li>See <a href="#verifying">Verifying the Installation</a> to verify that the tools were installed correctly | |
for the NetBeans IDE.</li> | |
</ol> | |
<h4>GNU Compilers and GNU <tt>make</tt></h4> | |
<p> | |
If you want to use the GNU compilers and GNU <tt>make</tt>:</p> | |
<ul> | |
<li>If you have a standard installation of the Solaris 10 OS, the compilers and | |
<tt>gmake</tt> are installed in <tt>/usr/sfw/bin</tt>. Make sure that this | |
location is in your <tt>PATH</tt> before starting the NetBeans IDE.</li> | |
<li>If the compilers and <tt>gmake</tt> are not installed on your system, you can download them from | |
<a | |
href="http://www.sunfreeware.com" target="_blank"><tt>http://www.sunfreeware.com</tt></a>.</li> | |
</ul> | |
<p><b>To download and install the GNU compilers and make utility</b></p> | |
<ol> | |
<li>Download <tt>gcc</tt> and <tt>make</tt>.</li> | |
<li>If the download zip files are not | |
automatically extracted during download, unzip them with <tt>gunzip</tt>. | |
</li> | |
<li>Install the packages with the <tt>pkgadd</tt> command.</li> | |
<li>Make sure to include the GNU | |
compiler directory and the GNU make directory in your path before starting the NetBeans IDE. | |
</li> | |
</ol> | |
<h4><tt>gdb</tt> Debugger</h4> | |
<p>Whether you use the Sun Studio compilers and Solaris <tt>make</tt> or the | |
GNU compilers and GNU <tt>make</tt>, you must have the <tt>gdb</tt> debugger to | |
debug applications in NetBeans IDE. You can download <tt>gdb</tt> from | |
<a href="http://www.sunfreeware.com" target="_blank">http://www.sunfreeware.com</a>.</p> | |
<p><b>To download and install <tt>gdb</tt>:</b></p> | |
<ol> | |
<li>Download <tt>gdb</tt> 6.6 or 6.8.</li> | |
<li>If the download zip file is not | |
automatically extracted during download, unzip it with <tt>gunzip</tt>. | |
</li> | |
<li>Install the package with the <tt>pkgadd</tt> command.</li> | |
<li>Make sure to include the path to <tt>gdb</tt> in your <tt>PATH</tt> before starting | |
the NetBeans IDE.</li> | |
<li>See <a href="#verifying">Verifying the Installation</a> to verify that the tools were installed correctly | |
for the NetBeans IDE.</li> | |
</ol> | |
<br> | |
<!-- COMPILER SETUP: OPENSOLARIS OS -----------------------> | |
<h3><a name="compilers_opensolaris"></a>OpenSolaris OS</h3> | |
<p> | |
On the OpenSolaris OS, you can use GNU tools or Sun Studio tools. Both tool | |
collections can be easily downloaded using the pkg command or Package Manager utility | |
from the OpenSolaris desktop.</p> | |
<p> | |
NetBeans IDE 6.8 has been tested with the following compilers | |
and tools.</p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Tested</th> | |
<th class="tblheader" scope="col">Description</th> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>cc</tt></td> | |
<td class="tbltd1">5.9 and 5.10</td> | |
<td class="tbltd1">Sun Studio 12 C compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>CC</tt></td> | |
<td class="tbltd1">5.9 and 5.10</td> | |
<td class="tbltd1">Sun Studio 12 C++ compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gcc</tt></td> | |
<td class="tbltd1">3.4.3</td> | |
<td class="tbltd1">GNU C compiler | |
<br>See the <a href="https://netbeans.org/community/releases/68/relnotes.html#known_issues-cnd"> | |
NetBeans IDE 6.8 release notes</a> for information about NetBeans and gcc in the OpenSolaris OS.</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>g++</tt></td> | |
<td class="tbltd1">3.4.3</td> | |
<td class="tbltd1">GNU C++ compiler. <br>See the <a href="https://netbeans.org/community/releases/68/relnotes.html#known_issues-cnd"> | |
NetBeans IDE 6.8 release notes</a> for information about NetBeans and gcc in the OpenSolaris OS.</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gdb</tt></td> | |
<td class="tbltd1">6.6</td> | |
<td class="tbltd1">GNU debugger (note that gdb 6.3 is in the OpenSolaris<br> | |
repository, and is not supported by NetBeans IDE 6.8). <br>gdb 6.6 was built on OpenSolaris | |
for testing purposes. <br>See the <a href="https://netbeans.org/community/releases/68/relnotes.html#known_issues-cnd"> | |
NetBeans IDE 6.8 release notes</a> for information about NetBeans and gdb in the OpenSolaris OS.</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gmake</tt></td> | |
<td class="tbltd1">3.81</td> | |
<td class="tbltd1">GNU make</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>make</tt></td> | |
<td class="tbltd1">-</td> | |
<td class="tbltd1">Solaris make</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>dmake</tt></td> | |
<td class="tbltd1">7.8 and 7.9</td> | |
<td class="tbltd1">Sun Studio 12 distributed make utility</td> | |
</tr> | |
</tbody> | |
</table> | |
<br><br> | |
<p><b>To download and install the Sun Studio 12 software and gdb debugger:</b></p> | |
<ol><li>Type the following in an OpenSolaris terminal window: | |
<pre>$ pfexec pkg install sunstudio gdb</pre></li> | |
<li>Edit your <tt>PATH</tt> to include the path to the Sun Studio compilers before starting | |
the NetBeans IDE. The path is <tt>/opt/SunStudioExpress/bin</tt> or <tt>/opt/SunStudio/bin</tt>.</li> | |
</ol> | |
<p><b>To download and install the GNU gcc compilers and gdb debugger:</b></p> | |
<ol><li>Type the following command in an OpenSolaris terminal window:<br> | |
<pre>$ pfexec pkg install SUNWgcc SUNWgccruntime gdb </pre> | |
</li> | |
<li>Links to the compilers and gdb are installed in /usr/bin, which is | |
most likely already on your path. If /usr/bin is not on your path, edit your <tt>PATH</tt> to | |
add it before starting the NetBeans IDE. </li></ol> | |
<!--<p>See the OpenSolaris wiki page <a href="http://wikis.sun.com/pages/viewpage.action?pageId=108496910" target="_blank"> | |
Installing C++, Fortran Development Tools</a> for more information. | |
</p>--> | |
<!-- COMPILER SETUP: LINUX OS --------------------------------> | |
<h3><a name="compilers_linux"></a>Linux</h3> | |
<p> | |
On Linux platforms, you can use GNU tools or Sun Studio tools.</p> | |
<p> | |
NetBeans IDE has been tested with the following compilers | |
and tools:</p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Tested</th> | |
<th class="tblheader" scope="col">Description</th> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>cc</tt></td> | |
<td class="tbltd1">5.9 and 5.10</td> | |
<td class="tbltd1">Sun Studio 12 C compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>CC</tt></td> | |
<td class="tbltd1">5.9 and 5.10</td> | |
<td class="tbltd1">Sun Studio 12 C++ compiler</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gcc</tt></td> | |
<td class="tbltd1">4.1.2, 4.2.3, and 4.3.3</td> | |
<td class="tbltd1">GNU C compiler in Red Hat 5 and Ubuntu 8.04</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>g++</tt></td> | |
<td class="tbltd1">4.1.2, 4.2.3, and 4.3.3</td> | |
<td class="tbltd1">GNU C++ compiler in Red Hat 5 and Ubuntu 8.04</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gdb</tt></td> | |
<td class="tbltd1">6.6 and 6.8</td> | |
<td class="tbltd1">GNU debugger in Red Hat 5 and Ubuntu 8.04</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gmake</tt></td> | |
<td class="tbltd1">3.81</td> | |
<td class="tbltd1">GNU make in Red Hat 5 and Ubuntu 8.04</td> | |
</tr> | |
</tbody> | |
</table> | |
<br><br> | |
<h4>Sun Studio 12 Compilers on Linux</h4> | |
<p>If you want to use the Sun Studio 12 compilers in a Linux OS:</p> | |
<ul> | |
<li>If you have Sun Studio 12 software installed, ensure that <tt>/<i>installation | |
directory</i>/sunstudio12/bin</tt> | |
is in your path before you start the NetBeans IDE. The default location | |
is <tt>/opt/sun/sunstudio12/bin</tt> when installing with Linux packages.</li> | |
<li> | |
If you do not have Sun Studio 12 software installed, you can | |
download it from developers.sun.com as described below. | |
</li> | |
</ul> | |
<p><b>To download and install the Sun Studio 12 compilers:</b></p> | |
<ol> | |
<li>Create a directory where you can download and expand the Sun Studio compressed archive file. | |
You must have write permission for this directory.</li> | |
<li>If your browser is set to install | |
in a particular location such as your Desktop or a Downloads directory without prompting, | |
set the browser preferences to download to the | |
directory you created. For Firefox, the download directory is set in Edit > Preferences > Main.</li> | |
<li>Go to <a href="http://developers.sun.com/sunstudio/downloads/" target="_blank"> | |
<tt>http://developers.sun.com/sunstudio/downloads/</tt></a> and download the file | |
for your platform into the download directory you created. If you are using Ubuntu, | |
choose the tarfile installation because the packages are for SUSE and Red Hat. Note also | |
that Ubuntu is not an officially supported platform for Sun Studio IDE, but the compilers | |
have been tested for use in NetBeans IDE and been found to work. | |
</li> | |
<li>After the download is complete, open a terminal, go to the download directory, and uncompress and untar the downloaded file. | |
<pre> | |
bzcat <i>filename</i> | tar xvf - | |
</pre> | |
</li> | |
<li> | |
If you downloaded the SUSE or RPM packages, follow the instructions in <a | |
href="http://docs.sun.com/app/docs/doc/820-2971/gemyi?a=view" target="_blank">Chapter 2 of the <i>Sun | |
Studio 12 Quick Installation (English, Japanese, Simplified Chinese)</i> | |
guide</a> to install.</li> | |
<li>If you downloaded the tar file</li> | |
<li>Edit your <tt>PATH</tt> to add the path to the Sun Studio software before | |
starting the NetBeans IDE.</li> | |
</ol> | |
<p><b>To download and install the GNU debugger in Red Hat 5, type:</b></p> | |
<pre>yum install gdb</pre> | |
<p><b>To download and install the GNU debugger in Ubuntu, type:</b></p> | |
<pre>apt-get install gdb</pre> | |
<!-- COMPILER SETUP: MAC OS X ----------------------------------> | |
<h3><a name="compilers_mac"></a>Macintosh OS X</h3> | |
<p> | |
NetBeans IDE has been tested with the following compilers | |
and tools:</p> | |
<table> | |
<tbody> | |
<tr> | |
<th class="tblheader" scope="col">Software or Resource</th> | |
<th class="tblheader" scope="col">Version Tested</th> | |
<th class="tblheader" scope="col">Description</th> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gcc</tt></td> | |
<td class="tbltd1">4.0.1</td> | |
<td class="tbltd1">GNU C compiler in Mac OS X 10.5</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>g++</tt></td> | |
<td class="tbltd1">4.0.1</td> | |
<td class="tbltd1">GNU C++ compiler in Mac OS X 10.5</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>gdb</tt></td> | |
<td class="tbltd1">6.3.5</td> | |
<td class="tbltd1">GNU debugger in Mac OS X 10.5</td> | |
</tr> | |
<tr> | |
<td class="tbltd1"><tt>make</tt></td> | |
<td class="tbltd1">3.81</td> | |
<td class="tbltd1">GNU make in Mac OS X 10.5</td> | |
</tr> | |
</tbody> | |
</table> | |
<br> | |
<p>Install the following packages that are provided with your Macintosh OS X:</p> | |
<ul> | |
<li>Xcode</li> | |
<li>X11</li> | |
</ul> | |
<p>These packages can also be downloaded from | |
<a href="http://developer.apple.com/mac" target="_blank">Apple Developer Connection</a> with | |
the free ADC membership.</p> | |
<br><!-- VERIFYING THE INSTALLATION ------------------------------------------> | |
<h2><a name="verifying">Verifying the Installation</a></h2> | |
<p>To verify that the installation is correct, start the NetBeans IDE, | |
build a sample project, and run it in the <tt>gdb</tt> debugger.</p> | |
<h3><a name="start">Start the NetBeans IDE</a></h3> | |
<p><b>To start the IDE, do one of the following:</b></p> | |
<ul> | |
<li>Open the NetBeans IDE icon on the desktop.</li> | |
<li>In Linux or Solaris platforms, navigate to the <tt>bin</tt> subdirectory of your NetBeans installation and | |
type <tt>./netbeans</tt>.</li> | |
<li>Launch the NetBeans IDE through the desktop's menus, as you do for other applications. | |
<br>This method is available on Windows and OpenSolaris platforms, but might not be | |
on Solaris 10 OS and some Linux platforms.</li> | |
</ul> | |
<h3><a name="test"></a>Build a Sample Project to Test the Tools</h3> | |
<p>On all platforms, you can build a sample project to test the compiler installation, | |
and run it in the debugger to test the gdb installation.</p> | |
<p><b>To build a sample project and run it in the debugger:</b></p> | |
<ol> | |
<li>Open the New Project wizard by choosing File > New Project.</li> | |
<li>In the Categories panel on the Choose Project page of the wizard, expand | |
the Samples category and select the C/C++ subcategory.</li> | |
<li>In the Projects panel, select the <tt>Welcome</tt> project. Click Next. | |
</li> | |
<li>On the Project Name and Location page, click Finish. | |
</li> | |
<li>In the Projects window of the IDE, right-click the <tt>Welcome_1</tt> project and | |
choose Build. If your compilers and <tt>make</tt> utility are | |
installed correctly and the path to them is set, build output is displayed in | |
the Output window and the project builds successfully. | |
</li> | |
<li>Double-click the <tt>welcome.cc</tt> file to open it in the Source | |
Editor.</li> | |
<li>Right-click in the left margin of the Source Editor window and choose | |
Show Line Numbers. | |
</li> | |
<li>Set a breakpoint by clicking in the left margin of the Source | |
Editor window next to any line. | |
</li> | |
<li>Right-click the project and choose Debug. If the <tt>gdb</tt> | |
debugger is installed correctly and the path to it is set, <tt>gdb</tt> starts | |
up, the Debugger tabs are displayed, and the <tt>Welcome</tt> application | |
runs and stops at the breakpoint. | |
</li> | |
<li>Choose Debug > Continue to run the application to completion. | |
</li> | |
</ol> | |
<!-- NEXT STEPS --> | |
<br> | |
<h2>Next Steps</h2> | |
<p>To learn quickly how to develop a C or C++ application with the NetBeans | |
IDE, see the <a href="../../../kb/docs/cnd/quickstart.html">C/C++ | |
Projects Quick Start Tutorial</a> | |
</p> | |
<div class="feedback-box"><a href="mailto:users@cnd.netbeans.org?subject=Feedback:%20Configuring%20NetBeans%20IDE%206.8%20for%20C/C++/Fortran">Send Us Your Feedback</a></div> | |
</body> | |
</html> |