NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

help for a newbie

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
usakov



Joined: 25 May 2012
Posts: 1

PostPosted: Fri May 25, 2012 2:49 pm    Post subject: help for a newbie Reply with 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)
Back to top
fordinina



Joined: 04 Jun 2012
Posts: 2

PostPosted: Mon Jun 04, 2012 12:06 pm    Post subject: Re: help for a newbie Reply with quote

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.





PostPosted: Mon Jun 04, 2012 4:06 pm    Post subject: help for a newbie Reply with quote

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

Quote:


Back to top
annahussy



Joined: 21 Jun 2012
Posts: 44
Location: india

PostPosted: Fri Jun 22, 2012 9:35 am    Post subject: Reply with quote

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

PostPosted: Tue Jul 24, 2012 6:50 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo