3

I've decided to relearn my C/C++ programming skills after not having used them since Borland Turbo C on MS-DOS went out the window. For this purpose I installed Netbeans 12 on Ubuntu 18.04 (including ccls and clangd, the paths to which are set under Tools -> Options -> C/++) and attempted to compile and run the obligatory hello.c to make sure it works. However, I'm quite confused about how to enter the properties for the new project. At step 3, Editor, I can enter Compile Commands which I guess might be /usr/bin/gcc (?) but what I am supposed to enter at step 4 I have no idea:

enter image description here

Attempts to compile and run hello.c unsurprisingly generate errors and fail:

Exception in thread "main" java.io.IOException: Cannot run program "": error=2, No such file or directory [...]

More to the point, though, I have Googled extensively and other than another unanswered question on SO about more or less the same issue I can't find anything in any of the documentation anywhere! I understand that NB12.4 is fairly fresh and that the documentation is a work in progress, but all I can find (such as the C/C++ Projects Quick Start Tutorial or Defining Your C/C++ Project’s Development Environment) is either very old (circa 2014; Netbeans versions 7 and 8, mostly) or doesn't even hint at any of this, much less discuss it.

Is this documented anywhere? If so, where? Any pointers in the right direction appreciated!

skomisa
  • 16,436
  • 7
  • 61
  • 102
  • 1
    Have you downloaded and installed the C/C++ plugin? Although your question is not a duplicate of [Error installing C/C++ plugin in Netbeans 12.4 with JDK 16 in Windows 10](https://stackoverflow.com/q/68027919/2985643), I believe the accepted answer addresses your concerns, since it explains how to create C/C++ projects using NetBeans 12.4. Hence, I am voting to close this question as a duplicate, but feel free to disagree. If you have successfully installed the C/C++ plugin, and that is not a valid duplicate, please update your question accordingly. – skomisa Aug 12 '21 at 14:46
  • Does this answer your question? [Error installing C/C++ plugin in Netbeans 12.4 with JDK 16 in Windows 10](https://stackoverflow.com/questions/68027919/error-installing-c-c-plugin-in-netbeans-12-4-with-jdk-16-in-windows-10) – skomisa Aug 12 '21 at 14:47
  • @skomisa: My confusion seems to stem from the fact that NB12.4 appears to support C/C++ (albeit in a light-weight implementation) without requiring plug-ins. I was under the impression that C/C++ plugins are/were only required in older NB versions. Under 'Available plugins' in NB12.4 there is nothing hinting at a C/C++ plug-in. So my question about where the existing C/C++ support is documented for out-of-the-box NB12.4 remains. – Frank van Wensveen Aug 12 '21 at 14:59
  • @skomisa: I found out how to add the Netbeans 8.2 plugin portal and install the C/C++ plugin. Apart from the counter-intuitive nature of requiring a plugin from the 8.2 portal for 12.4, the fact that 12.4 comes with at least light-weight C/C++ support which appears no-where in any documentation that I could find does not really duplicate the questions you refer to. That said, your references did point me in the right direction and with the 8.2 plugin installed it now works, so thanks! – Frank van Wensveen Aug 12 '21 at 15:08
  • 1
    OK. You are way ahead of me. While the C/C++ plugins are not supported with NetBeans 12.4, you are correct that lightweight support was implemented in release 12.1. I didn't know that. See [the C/C++ section of the 12.1 release notes](http://netbeans.apache.org/download/nb121/index.html) and [Temporary lightweight C/C++ support](https://github.com/apache/netbeans/pull/2234). Does any of that documentation help? – skomisa Aug 12 '21 at 15:21
  • Also, I retracted my close vote, and upvoted instead. Since you don't want to use the C/C++ plugin, that other question is not relevant. – skomisa Aug 12 '21 at 15:22
  • [1] This question needs more details (screens shots) on how you configured things in `Tools -> Options -> C/C++` if you are still interested in getting it resolved. [2] FYI, I see that there are [some bug fixes for cpplite in NetBeans 12.5](https://cwiki.apache.org/confluence/display/NETBEANS/Apache+NetBeans+12.5) which is to be released later this month. – skomisa Aug 12 '21 at 15:41
  • @skomisa It was indeed my understanding that the C/C++ plugins are not supported in 12.x but since your comment convinced me otherwise I did install the 8.2 plugins and they work (mostly). The Github link does discuss the lightweight C/C++ implementation in 12.x but the only hints at how to use it in the README.md file would be overly generous. The release notes however do mention that the 8.2 plugins work so that's what I missed. :) For now that solves my problem. Tnx!! – Frank van Wensveen Aug 13 '21 at 09:01

0 Answers0