Jump to content

Cannot run C code with netbeans + cygwin

- - - - -

  • Please log in to reply
3 replies to this topic

#1
xecure

xecure

    Newbie

  • Members
  • Pip
  • 2 posts
Hi everyone, I am absolutely new to C (and programming in general). I installed netbeans and cygwin (with gcc, gdb, make, binutils and libgcc1) and wrote my first C code just to try it.
#include <stdio.h>


main() {

  printf("Hello world!\n");

}
When II hit the build button everything goes smoothly in the console. But afterward when I run the program the cygwin terminal pops up and I get this error: Posted Image

Any idea what I can do to have my code run?Cannot run C code with netbeans + cygwin

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
You are running GCC on a POSIX emulation platform not natively, on Windows you should run a compiler port native to your system and the MinGW project is what you are looking for.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
Smilex

Smilex

    Learning Programmer

  • Members
  • PipPipPip
  • 84 posts
I will recommend Visual C++ for you (compiles C too). Although I dislike Microsoft and would like to avoid them at all times, I'll have to admit that I consider this the best IDE for C++, that there is. The compiler though, is not as good as GCC, but it's not far behind.

#4
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
I would recommend Code::Blocks as IDE, but I think we (most of us?) will agree that Visual Studio has one the best debuggers.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users