Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions netbeans.apache.org/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ task("run", type: JavaExec, group: "Run", overwrite: true) {

main "TomcatMain"
classpath buildscript.configurations.classpath + files("${rootProject.projectDir}/buildSrc/build/classes/main")
args = [bakedDir, 8080, "SHUTDOWN", 8081]
args = [bakedDir, 8080, "SHUTDOWN", 8082]
workingDir = wDir
}

task("stop", type: JavaExec, group: "Run", overwrite: true) {
main "TomcatStopMain"
classpath buildscript.configurations.classpath + files("${rootProject.projectDir}/buildSrc/build/classes/main")
args = ["SHUTDOWN", 8081]
args = ["SHUTDOWN", 8082]
}

wrapper {
Expand Down
2 changes: 2 additions & 0 deletions netbeans.apache.org/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ render:
template:
page:
file: page.gsp
tutorial:
file: tutorial.gsp
page-noaside:
file: page-noaside.gsp
wiki:
Expand Down
129 changes: 129 additions & 0 deletions netbeans.apache.org/src/content/kb/docs/cnd.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//

= C/C++ Application Learning Trail
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: C/C++ Application Learning Trail - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, C/C++ Application Learning Trail


==== Developing C, C++, and Fortran Applications

When you install the NetBeans IDE with C/C++ support, the IDE includes project types for C and C++ and appropriate templates. You can create C, C++, and Fortran applications with dynamic and static libraries, and you can also create C/C++/Fortran projects from existing sources. The editor indents, completes, and syntax-highlights C and C++ code and is well integrated with the GNU gdb debugger.

image::../../images_www/v6/trails/trails-box-tr.png[] image::../../images_www/v6/trails/trails-box-tl.png[]

= Getting Started
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: Getting Started - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, Getting Started

* link:../../community/releases/80/cpp-setup-instructions.html[+ Configuring NetBeans IDE for C/C++/Fortran+]
image::../../images_www/v6/trails/trails-box-br.png[] image::../../images_www/v6/trails/trails-box-bl.png[]image::../../images_www/v6/trails/trails-box-tr.png[] image::../../images_www/v6/trails/trails-box-tl.png[]

= Tutorials and Articles
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: Tutorials and Articles - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, Tutorials and Articles

*Creating C and C++ Projects*

* link:../docs/cnd/quickstart.html[+C/C++ Projects Quick Start Tutorial+]
* link:../docs/cnd/development-environment.html[+Defining Your C/C++ Project's Development Environment+]
* link:../docs/cnd/beginning-jni-linux.html[+Beginning JNI with NetBeans IDE and C/C++ Plugin on Linux+]

*Developing C and C++ Projects*

* link:../docs/cnd/navigating-editing.html[+Editing and Navigating C/C++ Source Files Tutorial+]
* link:../docs/cnd/debugging.html[+Debugging C/C++ Projects Tutorial+]
* link:../docs/cnd/remote-modes.html[+Modes of C/C++ Remote Development+]
* link:../docs/cnd/remotedev-tutorial.html[+C/C++ Remote Development Tutorial+]
* link:../docs/cnd/c-unit-test.html[+Adding Unit Tests to a C/C++ Project+]
image::../../images_www/v6/trails/trails-box-br.png[] image::../../images_www/v6/trails/trails-box-bl.png[]image::../../images_www/v6/trails/trails-box-tr.png[] image::../../images_www/v6/trails/trails-box-tl.png[]

= Tutorials and Articles
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: Tutorials and Articles - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, Tutorials and Articles

*C and C++ Project How-tos*

* link:../docs/cnd/HowTos.html[+C/C++ Application How-Tos+]
* link:../docs/cnd/depchecking.html[+Make Dependency Checking+]
* link:../docs/cnd/toolchain.html[+Using the C/C++ Tool Collection Descriptor+]
* link:../docs/cnd/cpp-vcs.html[+Storing NetBeans C/C++ Projects Under VCS+]
image::../../images_www/v6/trails/trails-box-br.png[] image::../../images_www/v6/trails/trails-box-bl.png[]image::../../images_www/v6/trails/trails-box-tr.png[] image::../../images_www/v6/trails/trails-box-tl.png[]

= Community-Contributed Docs
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: Community-Contributed Docs - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, Community-Contributed Docs

* link:http://wiki.netbeans.org/HowToCreate64-BitC/C++WindowsProgramWithNetBeans[+Setting up NetBeans IDE to Create 64-bit C/C++ Windows Executables+]
* link:http://wiki.netbeans.org/HowToSetup64-BitQt5WithNetBeans8.0OnWindows[+Setting up 64-bit Qt 5 on Windows to use with NetBeans IDE+]

image:::../../images_www/v6/arrow-button.gif[role="left", link="http://wiki.netbeans.org/CommunityDocs_Contributions"]

image::../../images_www/v6/trails/trails-box-br.png[] image::../../images_www/v6/trails/trails-box-bl.png[]image::../../images_www/v6/trails/trails-box-tr.png[] image::../../images_www/v6/trails/trails-box-tl.png[]

= Other Resources
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: Other Resources - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, Other Resources

* link:../72/cnd/index.html[+C/C++ Documentation for Earlier Releases+]
* link:http://wiki.netbeans.org/NetBeansUserFAQ#NetBeans_C.2FC.2B.2B_Development_Pack[+NetBeans C/C++ Plugin FAQs+]
* link:https://netbeans.org/projects/cnd/lists[+NetBeans C/C++ Mailing Lists+]
image::../../images_www/v6/trails/trails-box-br.png[] image::../../images_www/v6/trails/trails-box-bl.png[]
128 changes: 128 additions & 0 deletions netbeans.apache.org/src/content/kb/docs/cnd/HowTos.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//

= C/C++ Application How-Tos for Code Assistance
:jbake-type: tutorial
:jbake-tags: tutorials
:jbake-status: published
:syntax: true
:source-highlighter: pygments
:toc: left
:toc-title:
:description: C/C++ Application How-Tos for Code Assistance - Apache NetBeans
:keywords: Apache NetBeans, Tutorials, C/C++ Application How-Tos for Code Assistance

_Contributed by link:mailto:vladimir.kvashin@oracle.com[+_Vladimir Kvashin_+] and link:mailto:vladimir.voskresensky@oracle.com[+_Vladimir Voskresensky_+]
March 2013_ [Revision number: V8.0]

Code assistance is a set of IDE features that help you navigate and edit source code. For a C/C++ Project With Existing Sources or a C/C++ Project From Existing Binary, you can specify how your code will be parsed to enable the code assistance features of the IDE.

Note that the tips in this article mostly apply to projects from existing source or from an existing binary. For projects that are created and managed by the IDE code assistance configuration is not necessary.


=== Contents

image::images/netbeans-stamp-80-74-73.png[title="Content on this page applies to the NetBeans IDE 8.0/7.4/7.3"]

|===
|-  |<<questionmark,What To Do When Your Project Has a Question Mark in the Projects Window or a #include Directive is Underlined in Red>>

|-  |<<analyzer, Configuring Build Analyzer for Code Assistance>>

|-  |<<multiplatform,Configuring Code Assistance for a Multi-Platform Project>>

|-  |<<cannotbuild,Configuring Code Assistance When You Cannot Build the Project>>

|-  |<<definitiondeclaration,When a Hyperlink Goes to a Function Definition and When to a Declaration>>

|-  |<<namespace,Finding All Definitions of a Namespace>>

|-  |<<declaration,Seeing the Declaration Name of a Declaration Made in a Macro>>
|===


== What To Do When Your Project Has a Question Mark in the Projects Window

If your project has a question mark in the Projects window, or an ``#include`` directive is underlined in red, then your project has unresolved include directives. The IDE uses an internal parser that is used by Code Assistance features (Code Completion, Classes window, Navigator window, etc). The markings mean that this parser cannot resolve some ``#include`` directives, because the IDE project has an incorrect configuration. This might happen if the project was created from existing sources without help from debugging information or if, for example, the source files included new libraries since the IDE project was created.

Here are some possible reasons (arranged from most to least probable):

* Wrong or insufficient user include paths specified in the project, logical folder, or file properties
* Wrong or insufficient user-defined macros specified in the project, logical folder, or file properties
* Source file is included in the project by mistake
* Header file is not included in any source files and hence is included in the project by mistake

If you hold the mouse cursor over the project folder, a tooltip displays some information about the problem. For more information, you can right-click the project and select Code Assistance -> Failed #include/#error directives.

Try launching the Configure Code Assistance wizard by right-clicking the project and choosing Code Assistance > Configure Code Assistance to resolve the problem. If you know the location of the files that correspond to the failed include directive, then you can set up the project, logical folder, and file properties manually.


== Configuring Build Analyzer for Code Assistance

Suppose your application source code is managed with a version control system (VCS) such as Mercurial, and you create an IDE project from the source code. If you open the IDE project in the IDE and pull in changes from the VCS, you should build the IDE project so it is up to date with the modifications.

After you build your project in the IDE, the project is automatically updated by the IDE in the following ways:

* New compilation units are added to the IDE project.
* Existing compilation units are modified with new or changed user-defined includes and macros.
* Compilation units that are excluded from building are not excluded from code assistance.

The IDE uses a build analyzer to gather information from the build, using an interposing technique to catch system library exec calls on Oracle Solaris and Linux platforms. By default, the build analyzer is used when you create a project with existing sources and when you manually run Configure Code Assistance. If the build analyzer is not used, the output log of the build is used to capture information.

If you do not want the IDE to perform the project updates, you can disable the build analyzer as follows:

1. Right-click the project node in the Projects window and select Properties.
2. In the Project Properties dialog box, click the Code Assistance category.
3. Deselect the Use Build Analyzer option.

For source code projects that set up their own environment at build time, the build analyzer might not always work well. If a build fails when the Use Build Analyzer option is selected, you should check your build script to see if you have unset the ``LD_LIBRARY_PATH`` environment variable. If ``LD_LIBRARY_PATH`` is unset, you should also unset ``LD_PRELOAD`` . When these two variables are unset, the build analyzer is automatically disabled. If you cannot modify the build script, you can disable the build analyzer as described above, and the IDE can use the output log for build information.


== Configuring Code Assistance for a Multi-Platform Project

If you are developing a multi-platform project from existing code, you can use the same IDE project for different platforms. Create a configuration per platform and change the compiler collection, compiler options, and other project properties appropriately.

The Configure Code Assistance wizard also works on a per-configuration basis: it alters only the configuration that is currently active. So you can run it separately for each configuration and get different code assistance settings for different platforms.


== Configuring Code Assistance When You Cannot Build the Project

The Configure Code Assistance wizard is most efficient if you built your code with debugging information (the best options are ``-g3 -gdwarf-2`` for GNU compilers and just ``-g`` for Oracle Solaris Studio compilers.

If your project cannot be built or does not contain debugging information, the Configure Code Assistance wizard has a special mode called Search File System for C/C++ Header Files. In this mode, the NetBeans IDE tries to resolve failed include directives by searching the file system for headers. The wizard asks you to enter a path to search for headers. By default, the path searched is a project source root.

To use the wizard, right-click the project and choose Code Assistance > Configure Code Assistance. Follow the steps of the wizard to enable the IDE to update code assistance. Click the Help button to get information about each step.


== Using Hyperlinks to Navigate Between Invocations and Declarations

Hyperlink navigation lets you jump from the invocation of a function, class, method, variable, or constant to its declaration. To use a hyperlink, do one of the following:

* Mouse over a class, method, variable, or constant while pressing Ctrl. A hyperlink appears along with a tooltip with information about the element. Click the hyperlink and the editor jumps to the declaration. Press Alt+Left to jump back to the invocation.
* Mouse over an identifier and press Ctrl+B. The editor jumps to the declaration.
* Press Alt+Left to jump back to the invocation. Press Alt+Left and Alt+Right to move backward and forward through the history of the cursor position.

You can also right-click the item and select Navigate > Go to Declaration/Definition, or other options to navigate through your code.


== Finding All Definitions of a Namespace

A namespace can be defined in different files of the project. To navigate between different namespace definitions, use the Classes window (Ctrl-9). Right-click the namespace you are interested in and choose All Declarations. You will see a list of all definitions sorted by file names.

link:mailto:users@cnd.netbeans.org?subject=subject=Feedback:%20C/C++%20Application%20How-Tos%20-%20NetBeans%20IDE%208.0[+Send Feedback on This Tutorial+]
Loading