Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For example, you want to add the directories in <code>C:\Program Files (x86)\Example\1.0\include\</code> as the include paths.</p> <p>First, set up code assistance:</p> <ul> <li>NetBeans > Tools > Options > C/C++ > Code Assistance <ul> <li>C Compiler > Include Directories: <ul> <li><code>C:\Program Files (x86)\Example\1.0\include\shared</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include\other</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include</code></li> <li><code>C:\MinGW\include</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include-fixed</code></li> <li>...</li> </ul></li> <li>C++ Compiler > Include Directories: <ul> <li><code>C:\Program Files (x86)\Example\1.0\include\shared</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include\other</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include\c++</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include\c++\mingw32</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include\c++\backward</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include</code></li> <li><code>C:\MinGW\include</code></li> <li><code>C:\MinGW\lib\gcc\mingw32\4.7.0\include-fixed</code></li> <li>...</li> </ul></li> <li>OK.</li> </ul></li> </ul> <p>The <code>C:\MinGW\...</code> directories are examples only. Do not actually add them. NetBeans should have detected and added the MinGW directories automatically. If not, try resetting the settings:</p> <ul> <li>NetBeans > Tools > Options > C/C++ <ul> <li>Code Assistance <ul> <li>C Compiler > Reset Settings</li> <li>C++ Compiler > Reset Settings</li> </ul></li> <li>Build Tools <ul> <li>Restore Defaults</li> </ul></li> </ul></li> </ul> <hr> <p>For instructions on automatic code assistance for existing sources, see:</p> <ul> <li><p>C/C++ Projects Quick Start Tutorial:</p> <p><a href="http://netbeans.org/kb/docs/cnd/quickstart.html#makefileprojects" rel="nofollow noreferrer">http://netbeans.org/kb/docs/cnd/quickstart.html#makefileprojects</a></p></li> <li><p>How to Configure Code Assistance When Creating a Project from Existing Code:</p> <p><a href="http://netbeans.org/kb/docs/cnd/configuring-code-assistance.html" rel="nofollow noreferrer">http://netbeans.org/kb/docs/cnd/configuring-code-assistance.html</a></p></li> </ul> <hr> <p>Now, configure the project options:</p> <ul> <li>Right click on project > Properties <ul> <li>Configuration: &lt;All Configurations></li> <li>Build <ul> <li>C Compiler <ul> <li>General <ul> <li>Include Directories: <ul> <li><code>C:\Program Files (x86)\Example\1.0\include\shared</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include\other</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include</code></li> </ul></li> </ul></li> <li>Compilation Line <ul> <li>Additional Options: <ul> <li><code>-std=c11 -g3 -pedantic -Wall -Wextra -O0</code></li> </ul></li> </ul></li> </ul></li> <li>C++ Compiler <ul> <li>General <ul> <li>Include Directories: <ul> <li><code>C:\Program Files (x86)\Example\1.0\include\shared</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include\other</code></li> <li><code>C:\Program Files (x86)\Example\1.0\include</code></li> </ul></li> </ul></li> <li>Compilation Line <ul> <li>Additional Options: <ul> <li><code>-std=c++11 -g3 -pedantic -Wall -Wextra -O0</code></li> </ul></li> </ul></li> </ul></li> </ul></li> <li>OK.</li> </ul></li> </ul> <p>For adding command-line options by default for all projects, see:</p> <ul> <li><a href="https://stackoverflow.com/questions/4114042/netbeans-settings-for-gcc/11643274#11643274">NetBeans settings for GCC</a></li> </ul> <p>Any spaces in the path should be automatically escaped. Any backward slashes should be replaced with forward slashes automatically.</p> <p>For example, the "All options" textbox in "Additional Options" looks like this:</p> <pre><code>-std=c11 -g3 -pedantic -Wall -Wextra -O0 -g -I/C/Program\ Files\ \(x86\)/Example/1.0/include/shared -I/C/Program\ Files\ \(x86\)/Example/1.0/include/other -I/C/Program\ Files\ \(x86\)/Example/1.0/include </code></pre> <p>If this does not work, you may have to fix the path and add the includes manually in the additional options. For example, replace <code>/C/</code> with <code>C:/</code>.</p> <pre><code>-std=c11 -g3 -pedantic -Wall -Wextra -O0 -g -IC:/Program\ Files\ \(x86\)/Example/1.0/include/shared -IC:/Program\ Files\ \(x86\)/Example/1.0/include/other -IC:/Program\ Files\ \(x86\)/Example/1.0/include </code></pre> <p>If you are using Cygwin <code>make</code> and if you try to clean or rebuild the project with colons in the command, you may get a <code>*** multiple target patterns. Stop.</code> error message. According to the answers from <a href="https://stackoverflow.com/questions/10614758/multiple-target-patterns/">Multiple target patterns?</a> and <a href="https://stackoverflow.com/questions/2401976/very-simple-application-fails-with-multiple-target-patterns-from-eclipse/">Very simple application fails with &quot;multiple target patterns&quot; from Eclipse</a>, "<code>make</code> sees the <code>:</code> in the path and thinks it is another target definition, hence the error."</p> <p>The workaround is to delete the generated <code>build</code> and <code>dist</code> folders every time before you build your project. However, this can be annoying, so you could try MinGW MSYS <code>make</code> instead (not to be confused with MinGW <code>make</code>, which is <a href="http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw" rel="nofollow noreferrer">unsupported</a>).</p> <p>For MinGW and MSYS configuration instructions, see:</p> <ul> <li><p>Configuring the NetBeans IDE for C/C++/Fortran:</p> <p><a href="http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw" rel="nofollow noreferrer">http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw</a></p></li> </ul> <p>For working with MinGW and Unicode, you should install the latest version of MinGW-w64. See:</p> <ul> <li><a href="https://stackoverflow.com/questions/3571250/wwinmain-unicode-and-mingw/11706847#11706847">wWinmain, Unicode, and Mingw</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload