Setting Default NetBeans Options (-std=c99, -Wall) for C programs

戏子无情 提交于 2019-11-29 09:10:58
XP1

Here are some different things that you can do:

  1. Copy and share the configuration files between projects, so you won't have to set every setting.
  2. Create a default project, and configure however you like it. When you want to create a new project, just copy the default project and rename it to something else.
  3. Modify your toolchain properties.

For details, see here:

NetBeans settings for GCC

You can create a Project Template Module. I was aware this is possible but didn't try it before, and this link is explaining how to do it;
https://blogs.oracle.com/seapegasus/entry/tip_create_your_own_project

(First you need NetBeans with platform SDK, not just C/C++ Bundle.)

I followed steps;

  • Open/Create your project with settings you want to use.
  • Create a NetBeans module project, choose a Code Base Name, i gave my.templates.ctemplate1
  • Add "Module Development > Project Template" to the module project. Choose your C project in "Select Project" step.
  • At next step select the Category as C/C++ and give a name for template i used MyCTemplate1.
  • Right click on module project and select "Create NBM", it will create my-templates-ctemplate1.nbm in the build folder of the module project.
  • Tools > Plugins > Downloaded , click "Add Plugin" and point to the nbm file in the build folder. Select install, it will give warnings because it's not signed.
  • When you want to create a new C/C++ project you will see your template in the wizard which will have all the settings as your first C project has.

Enjoy other possibilities; files, folders in original project will be there.

Mike

Have you tried editing your netbeans.conf file (for me, it's in /usr/local/netbeans-7.0.1/etc/netbeans.conf) and adding the options you need to the netbeans_default_options line? From looking at my version of the file, you might need to prepend -J to the switches (hence -Wall would become -J-Wall.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!