NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
usakov
Joined: 25 May 2012 Posts: 1
|
Posted: Fri May 25, 2012 2:49 pm Post subject: help for a newbie |
|
|
Hi!
I'm writing a small gui program using the XForms library. I can compile it from the terminal with this command:
gcc -o main main.c -lforms -lX11 -lm
It runs from the terminal, but in NetBeans the buliding fails, I can't run it! I guess it is because the IDE can't use the xforms, X11, and math libraries. How shall I set these things? I have read something about the pkg-config, but I didn't really understand it (well, I installed Ubuntu only 2 weeks ago)
Thank you for your help in advance!
Here is the output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/ftdszufgt
make[2]: Entering directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
mkdir -p dist/Debug/GNU-Linux-x86
gcc -o dist/Debug/GNU-Linux-x86/ftdszufgt build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `yes_callback':
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:7: undefined reference to `fl_finish'
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:16: undefined reference to `fl_initialize'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:17: undefined reference to `fl_bgn_form'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:18: undefined reference to `fl_add_box'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:19: undefined reference to `fl_add_button'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:20: undefined reference to `fl_set_object_callback'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:21: undefined reference to `fl_add_button'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:22: undefined reference to `fl_set_object_callback'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:23: undefined reference to `fl_end_form'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:24: undefined reference to `fl_show_form'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:25: undefined reference to `fl_do_forms'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/ftdszufgt] Error 1
make[2]: Leaving directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 473ms) |
|
| Back to top |
|
 |
fordinina
Joined: 04 Jun 2012 Posts: 2
|
Posted: Mon Jun 04, 2012 12:06 pm Post subject: Re: help for a newbie |
|
|
| usakov wrote: | | I guess it is because the IDE can't use the xforms, X11, and math libraries. |
Yeah, I think that's the most possible reason |
|
| Back to top |
|
 |
Andrew Krasny Posted via mailing list.
|
Posted: Mon Jun 04, 2012 4:06 pm Post subject: help for a newbie |
|
|
25.05.12 18:50, usakov::
| Quote: | Hi!
I'm writing a small gui program using the XForms library. I can compile it from the terminal with this command:
gcc -o main main.c -lforms -lX11 -lm
It runs from the terminal, but in NetBeans the buliding fails, I can't run it! I guess it is because the IDE can't use the xforms, X11, and math libraries. How shall I set these things? I have read something about the pkg-config, but I didn't really understand it (well, I installed Ubuntu only 2 weeks ago)
Thank you for your help in advance!
Here is the output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/ftdszufgt
make[2]: Entering directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
mkdir -p dist/Debug/GNU-Linux-x86
gcc -o dist/Debug/GNU-Linux-x86/ftdszufgt build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `yes_callback':
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:7: undefined reference to `fl_finish'
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:16: undefined reference to `fl_initialize'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:17: undefined reference to `fl_bgn_form'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:18: undefined reference to `fl_add_box'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:19: undefined reference to `fl_add_button'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:20: undefined reference to `fl_set_object_callback'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:21: undefined reference to `fl_add_button'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:22: undefined reference to `fl_set_object_callback'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:23: undefined reference to `fl_end_form'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:24: undefined reference to `fl_show_form'
/home/senbonzakura/NetBeansProjects/ftdszufgt/main.c:25: undefined reference to `fl_do_forms'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/ftdszufgt] Error 1
make[2]: Leaving directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/senbonzakura/NetBeansProjects/ftdszufgt'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 473ms)
|
You need to pass additional options to linker. To do that you should
open project options (right-click project, select Properties),
Then Build/Linker/Libraries/.../ and there are several choices there...
I guess you can just use 'Add Option'/Other Option and type in '-lX11
-lforms -lXpm'...
=Andrew
|
|
| Back to top |
|
 |
annahussy
Joined: 21 Jun 2012 Posts: 44 Location: india
|
Posted: Fri Jun 22, 2012 9:35 am Post subject: |
|
|
| Hi this is annahussy , I gave training regarding C language and I also run many program as well. But, When I was enter to run the program , I couldn't even find that what the exactly error it is. It was just showing that the server error. What was that? |
|
| Back to top |
|
 |
annahussy
Joined: 21 Jun 2012 Posts: 44 Location: india
|
Posted: Tue Jul 24, 2012 6:50 am Post subject: |
|
|
| memoonamike wrote: | | Where you gave the training of C language? |
I get the training from online tutorial. I learned many languages as well. If you going through online then You will also get many resources as well. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|