Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can build, but can't run C code in netbeans (but it works in command line)

Tags:

exit

netbeans

when I try Building the .exe of my code in C inside NB it makes it successful, but when I try to run it inside the program I always get this error:

Unable to start pty process: 
RUN FAILED (exit value -2, total time: 31ms)

But when I go inside the Run proprieties of the project and set the "Console Type" parameter to "External Terminal" it runs in the command line OK.

Any idea about what it could be? I am working with cygwin.

like image 332
Ramon Blanquer Avatar asked Aug 05 '13 01:08

Ramon Blanquer


People also ask

Can we run C program in NetBeans?

NetBeans C/C support lets you create C and C Application and Library projects with generated makefiles, as well as C and C++ projects with existing sources. You can build, run, and debug your project on the local host (the system from which you started the IDE) or on a remote host running a UNIX® operating system.

How do I enable completion code in NetBeans?

To invoke code completion press Ctrl + Space or, choose Source > Complete Code…

How do I get code suggestions in NetBeans?

It is easy to enable Java hints in NetBeans. Select "Tools" from the title bar, then select "Options" from the drop-down menu. Choose the "Editor" option and then select the "Hints" tab. At this point, make sure that the "Language" drop-down is set to "Java" (other choices include PHP, JavaScript, and Ruby).


1 Answers

I fixed the problem going to Properties Project -> Run -> Console Type -> External Terminal. In this way you can compile using Netbeans.

like image 197
Mazzy Avatar answered Sep 18 '22 15:09

Mazzy