Before I answer the question, I would like to thank steff for guiding me in the right direction, thus allowing me to solve the problem, please give his answer an upvote if you deem it worthy.
My Installation Info
Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_112; Java HotSpot(TM) 64-Bit Server VM 25.112-b15
Runtime: Java(TM) SE Runtime Environment 1.8.0_112-b15
System: Windows 10 version 10.0 running on amd64; Cp1252; en_ZA (nb)
Setting Up Netbeans, etc
Orignally, I had install mingw32, as specified by the netbeans documentation page for seting up netbeans with c++, this is to setup the compiler for c++ (since it appears not to do this automatically).
I follow all the steps, adding the path to the environment, and not changing any installation paths, to keep it as to the "tutorial" as possible.
After coding and importing code, I ran into the error mentioned above, and so steff suggested to use the MinGW64 compiler, where I had just used the mingw32 compiler.
Solution
Overview of steps taken (my solution)
- Install MinGW64
- Add toolchain (aka compiler)
- Change project toolchain ( aka compiler)
1.
MinGW64 setup found here from sourceforge
Install this, changing no settings ofcourse.
2.
Opening up netbeans > Tools > Options > C/C++ tab.
Here I have MinGW on the left, that is the pre installed compiler, which exists due to the installation instructions from the documentation page (the MinGW32 compiler/toochain which is giving the error)
Click Add (to add new compiler), browse to the location of the newly install MinGW64 compiler, mine is in:
C:\Program Files\mingw-w64\x86_64-6.2.0-win32-seh-rt_v5-rev1\mingw64\
Name the compiler something appropriate, I named mine "MinGW_64" and for the Tool Collection Family, select the "GNU MinGW", and click ok.
- Now, adding the links to the compiler exe's.
In my case, I had to fill in 2 sections, namely the C Compiler
field and the C++ Compiler
field.
Please note I am unsure as to which specific exe the c++ fied should point to, I just selected the c++.exe
, this compiler solved my problem, I am unsure of the gcc.exe
Please see image below as a reference.

After this is done, make the MinGW64 compiler your default compiler.
3.
Finally, if you have an open project in which this error occurs (which I assume is most probably the case), there is one last thing to do.
Right click on your project > Properties > Build.
Look for the option "Tool Collection", the corresponding compiler name should be "MinGW" (same name as that of the compiler I refered to earlier - the faulty one), this should be changed to the new MinGW_64 compiler you have just installed and added in the Tools > Options > C/C++ section.
DONE!
Close your project properties, the project should reparse automatically, if not, right click on project > Code Assistance > Reparse Project, wait for reparse and your problem should be solved.
I really hope this helps.