When I click on project properties I can set Warning level
(More Warnings
) and Command Line -> Additional Options
(-std=c99
). But I want that all my C project have that kind of options by default without manually setting them everytime I create new project.
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
For each project, the configuration properties are saved in the
\nbproject\configurations.xml
(%UserProfile%\Documents\NetBeansProjects\ProjectName\nbproject\configurations.xml
) file.You could share the
configurations.xml
file between projects so that you won't have to change and apply every setting.You could create a default project and configure it however you like. Instead of creating a new project, you could copy it, and name it something else.
If you want the toolchain properties to apply to every project, you will need to manually modify your toolchain definition or create a new one.
Generate shadow copies of the tool collection descriptors:
%ProgramFiles%\NetBeans x\etc\netbeans.conf
:%ProgramFiles%\NetBeans x\
.etc
folder > Properties > Security > Edit... > Under "Group and user names", select the "Users" group > Under "Permissions for Users", for "Full control", enable "Allow" > OK > OK.Open
%ProgramFiles%\NetBeans x\etc\netbeans.conf
in a text editor that can handle the newlines.On the line starting with
netbeans_default_options
, add-J-Dcnd.toolchain.personality.create_shadow=true
to the string of values.For example, the line may now look like:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Dcnd.toolchain.personality.create_shadow=true"
toolchain.properties
file in%Appdata%\NetBeans\x\config\Preferences\org\netbeans\modules\cnd\
. Intoolchain.properties
, remove the linetoolchain_shadow=true
, and save.netbeans_default_options
, remove-J-Dcnd.toolchain.personality.create_shadow=true
from the string of values. In other words, undo the edit to restore the file back to its original state.Modify or create the toolchain definition:
%Appdata%\NetBeans\x\config\CND\ToolChain\
(7.2+) or%UserProfile%\.netbeans\x\config\CND\ToolChain\
(7.1.2-).MinGW.xml
.Within the
c
element, there is adevelopment_mode
element containing the different development mode option elements. You can modify the flags for a particular development mode by modifying theflags
attribute.For example, when you add the
-std=c11 -g3 -pedantic -Wall -Wextra -O0
flags, the attributes may look like this:Within the
cpp
element, there is adevelopment_mode
element containing the different development mode option elements. You can modify the flags for a particular development mode by modifying theflags
attribute.For example, when you add the
-std=c++11 -g3 -pedantic -Wall -Wextra -O0
flags, the attributes may look like this:For finding the
netbeans.conf
configuration file on different platforms, see:How do I make my custom startup parameters permanent?
http://wiki.netbeans.org/FaqNetbeansConf
For finding the user directories on different platforms, see:
What is a userdir and where can I find it? What is a cachedir and where can I find it?
http://wiki.netbeans.org/FaqWhatIsUserdir
For information on tool collection descriptors, see:
Using the C/C++ Tool Collection Descriptor - NetBeans IDE 6.9 Tutorial:
http://netbeans.org/kb/69/cnd/toolchain.html
First download and install Code::Blocks IDE from Code::Blocks IDE Downlowd and MSYS 1.0.11
All setting will automatically configured, but you have to select "make" command from
This is not currently possible in NetBeans.
Using netBeans 8.1 under Windows 7 Professional with MinGW (gcc), I found the file
C:\Users\Username\AppData\Roaming\NetBeans\8.1\config\Preferences\org\netbeans\modules\cnd*toolchain.properties*,
but I can't find the folder
C:\Users\Username\AppData\Roaming\NetBeans\8.1\config\CND
(so I can't find C:\Users\Username\AppData\Roaming\NetBeans\8.1\config\CND\ToolChain)
I found the folder
C:\Users\Username\AppData\Roaming\NetBeans\8.1\config\Preferences\org\netbeans\modules\cnd
but there's no MinGW.xml file there. I find this MinGW.xml file nowhere on the hard disk drive where NetBeans (and MinGW) are installed.