c++netbeansc++17netbeans-8netbeans-11

How do you enable C++17 in Netbeans?


In Tools > Options > C/C++ > Other, there is no option for C++17 as the default standard.

How do you compile code that requires C++17?


Solution

  • Updated 3/28/21 for NetBeans 12, as documented at the end of this answer.

    The C++17 standard was published over a year after NetBeans 8.2 was released, so C++17 is not available as an option in the standard release of 8.2.

    However, NetBeans Bug Report Bug 271136 - Support C++17 standard addressed this deficiency, and if you download and install any of the most recent nightly builds of NetBeans 8.2 from 2018 the issue is resolved; C++17 is available as an option when creating a C++ project:

    selectCpp17

    If you then select {project} > Properties > Build > C++ Compiler you can verify that the C++17 standard is being used:

    projectProperties

    Notes:


    Updated 1/21/20 and 1/22/20:

    These are the steps needed to make C++17 available on NetBeans 11.2:


    Updated 3/28/21 for NetBeans releases 12.x:

    Bad news: NetBeans no longer officially supports C++! See the definitive response from Geertjan Welenga, leader of the NetBeans Team, dated 3/25/21 in response to the recent bug report NETBEANS-5501 C++17 no longer available:

    *At the moment, NetBeans doesn't support C/C++, the plugins you were/are using from 8.2 are not really officially supported, though work on this is ongoing here, with an end goal to having it officially part of NetBeans, though that will take a while:
    
    https://lists.apache.org/thread.html/r4ac84633554ce80d99b0710e7a803ce1dc322680c914b18058876b51%40%3Cdev.netbeans.apache.org%3E
    
    You're welcome to join in with the discussions on dev above.*
    

    That said, there is an unofficial workaround, as detailed in bug report NETBEANS-4452 The Plugin Installer found problem timeout of loading C/C++ Remote Development API... while install the following plugins: C++. That is: