GCC C++ “Hello World” program -> .exe is 500kb big when compiled on Windows. How can I reduce its size?

The problem here is not so much with the library as it is with the way the library is linked. Granted, iostream is a moderately huge library but I don’t think it can be so huge as to cause a program to generate an executable that is 900KB larger than a similar one that uses … Read more

Undefined reference to class constructor, including .cpp file fixes

The undefined reference error indicates that the definition of a function/method (i.e constructor here) was not found by the linker. StaticObject::StaticObject(Graphics*, sf::String, sf::Vector2<float>) And the reason that adding the following line: #include “GameObject/StaticObject.cpp” fixes the issue, is it brings in the implementation as part of the main.cpp whereas your actual implementation is in StaticObject.cpp. This … Read more

can cmake and netbeans play nice?

Good news! As of NetBeans 6.8, CMake is handled gracefully, just like any other configure script: Make a new “C/C++ Application from existing sources”. Specify the directory of the project (where CMakeLists.txt resides). In the “Select configuration mode”, select “Automatic”. And NetBeans will run cmake to build the Makefile when it’s necessary (or when you … Read more

How to count lines in a netbeans project

You can use wordcount that works with 7.1 nb-wordcount that works with 8.2. To configure wordcount go in Tools->Options->Miscellaneous. You have to change Accept filename if you want other files than Java and Groovy to match. To display the count window go in Window->Open WordCount Window. To display stats click on WordCounting (second button). I … Read more

NetBeans background scanning projects takes too long

Having the same issue with 8.0.2 when a project has JS resources I tracked it down in my case to a problem with the javascript2 editor module which has been updated over the original version shipping with netbeans 8.0.2. I simply solved it by removing the updated module. On Linux: rm ~/.netbeans/8.0.2/modules/org-netbeans-modules-javascript2-editor.jar However, after letting … Read more

What useful macros have you created in Netbeans? [closed]

Here is a list of macro codes with short explanations. Might be useful for someone. Update: replaced old link with one to the Netbeans site and included the macro list in here. abbrev-debug-line Debug Filename and Line Number adjust-caret-bottom Move Insertion Point to Bottom adjust-caret-center Move Insertion Point to Center adjust-caret-top Move Insertion Point to … Read more