0

I am currently building a program in C in netbeans at Ubuntu (Linux OS) and I want to parse it to valgrind for memory leaks. So I want to locate the executable that Netbeans create and run it throught terminal with valgrind. So far I cannot locate where Netbeans saves the executable so I am stuck. I know that I can compile the program from terminal but I have a lot of files in different folders so it would be convinient if I could just take the executable from Netbeans.

Alternatively is any way to connect the Netbeans IDE with valgrind?

Thanks in advance

JmRag
  • 1,443
  • 7
  • 19
  • 56
  • Build your program on a command line, e.g. using [make](http://www.gnu.org/software/make/) (see [this](http://stackoverflow.com/a/14180540/841108)). You don't need any IDE, just use a good editor like [emacs](http://www.gnu.org/software/emacs/) – Basile Starynkevitch Jan 31 '14 at 19:21
  • @BasileStarynkevitch my problem is that in my project I have about 40 files in different folders. So making a makefile or compiling it throught terminal would require a lot of time and would be painful. – JmRag Jan 31 '14 at 19:22
  • No, writing a makefile for a small 40 files project is easy. I added a link to some example. You can adapt it to suit your needs. See also [this](http://stackoverflow.com/a/8025816/841108) – Basile Starynkevitch Jan 31 '14 at 19:23
  • @BasileStarynkevitch ok I will go this way since it doesn't exist any better solution, but how do you set the path for a .c file from a different folder? – JmRag Jan 31 '14 at 19:26
  • You just type the file path (you can set some `Makefile` variable, e.g. `SOURCELIST=` to a list of files) Notice that Linux don't have folders (it is a desktop illusion), only directories. – Basile Starynkevitch Jan 31 '14 at 19:27

1 Answers1

2

I finally found it. For everyone looking where the executable is located go to:

NetBeansProjects->ProjectName->dist->Debug->GNU LINUX(x86)

and there, is located the output when you click debug tool on Netbeans. For convinience right click on it and then make link and drag the link wherever you like/

JmRag
  • 1,443
  • 7
  • 19
  • 56