I have NetBeans 6.9 installed and working fine on Ubuntu Linux 11.10. My goal is to set compiler options like -Wall
and -std=c99
to be used by default. Currently, I have to right click on my project -> Properties -> C Compiler -> Warning Level to "More Warnings" and add -std=c99
to Additional Options. This is obviously a pain when creating many projects, and I'm sure there is a way to make all of this the default.
I found this thread which relates closely to my question. However, the only answer involves installing Code::Blocks and MSYS 1.0.11, which doesn't make much sense to me. I don't see how installing another IDE will help me, and MSYS seems unnecessary, as I am already using Linux.
I have tried every reasonable search term I can imagine, and am very surprised how little info I have turned up. It seems like most everyone who uses NetBeans should have to change this type of thing at some point. Terms I'm searching for: 'NetBeans -std=c99 default', 'NetBeans set default compile options', 'how to make NetBeans use c99 by default' and 'Code::Blocks settings into NetBeans'.
Please, someone point me in the right direction, or tell me what I should be searching for. I imagine that others have this same question, so I hope this thread is helpful.
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;
Enjoy other possibilities; files, folders in original project will be there.
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 thenetbeans_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
.)Here are some different things that you can do:
For details, see here:
NetBeans settings for GCC