0

I want to configure netbeans 7.4 settings for c++. I'm posting here because netbeans forums are close to dead. Can anyone tell me how to do the following things :-

1) When you create a new project of a 'new application' type, main.cpp is already there with some code. I want that main.cpp to be completely empty when I create a new project.

2) When you compile/build your program and run it, the output is shown in a small log window at the bottom. I want it to be shown like in a black output terminal (console ?) just like in Visual Studio or CodeBlocks. (I have some reasons for not using them instead, so don't bother about me not using them)

3) When you click the green 'Run' icon in the upper toolbar, the project is compiled/build again and then runs afterwards. I want it to just run without compiling. (Compiling/Building should be done by 'Build' icon, just like in CodeBlocks or Visual Studio)

Any help would be appreciated.

Silver Falcon
  • 176
  • 1
  • 1
  • 11

1 Answers1

1

Edit Templates:

Tools -> Templates -> C++ -> C++ Main File -> Open In Editor

Run Without Recompiling: In Terminal Window, click "Re-Run" - incorrect, re-researching...

*edit: found this explanation on the 'net:

"The trick is to look at the .xml files in the harness directory inside the installation of NetBeans. Search for the one containing the "run" target and copy the target into your project's build.xml, renaming it (e.g. to fastrun). Then, remove in the "depends" attribute the reference to the targets that build the system. For instance, for RCP applications this does the trick (sorry, I've never done this in regular applications, but shouldn't bee too different):

<target name="fastrun" depends="-init,branding,-jdk-init"> 
<ant antfile="${harness.dir}/run.xml" target="run"/> 
</target>

-http://forums.netbeans.org/post-1041.html"

  • your first answer just opens default main.cpp (with default code) in a new tab. What I wanted was that when I create a new project, the main.cpp should be empty just like when you open notepad, its empty!. =============================================================================== Regarding Re-Run, I have tried this. This just like 'Run' compiles again and then run the program. :( =============================================================================== you haven't answered my second question (how to show separate output console). :/ – Silver Falcon Nov 22 '13 at 15:55
  • The default main.cpp is what opens when you create a new project. Simply delete the contents of the default main.cpp and save it. When you open up a new project, it will once again load the default main.cpp (which you just edited) and will be blank. || I'm not certain of how to solve your second question. || Ahh, right you are; it does re-build it, doesn't it? I shall continue to research... – Steve Henningsgard Nov 22 '13 at 16:03
  • Have you found the solution to question 2 and 3? – Silver Falcon Nov 25 '13 at 12:04