nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

gcc linking error

This is a discussion on gcc linking error within the Coding in General forums, part of the Development/Scripting category; Hi, I was tryign to install svgalib for using graphics in C. Tried to install svgalib. though i followed the ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 09-27-2005, 09:58 AM
Junior Member
User
 
Join Date: Sep 2005
Posts: 24
Rep Power: 0
kavi
Default gcc linking error

Hi,
I was tryign to install svgalib for using graphics in C. Tried to install svgalib. though i followed the instructions for installation correctly to my knowledge, i am getting the following error when i tried to compile a program.
gcc sample.c -o sample -lvga.c
gives me the following error

/usr/bin/ld: cannot find -lvga
collect2: ld returned 1 exit status

All the header files were installed in /usr/local/includel
so used ln /usr/include/vga* -> /usr/local/include/vga*
since i was trying to link vga.h. but still it did not work
I have used previous gcc -lm to include math.h.
any views why this error occurred?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-27-2005, 07:48 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default

I'm also having same error.. I think this vga/svga lib is related to display card... not sure but just guess ... if any one got any clue pleaez reply back
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
  #3 (permalink)  
Old 09-28-2005, 09:25 AM
Junior Member
User
 
Join Date: Sep 2005
Posts: 24
Rep Power: 0
kavi
Default

Quote:
Originally Posted by sweta
I'm also having same error.. I think this vga/svga lib is related to display card... not sure but just guess ... if any one got any clue pleaez reply back
well lets see. hope monk or vivek have an answer......
Reply With Quote
  #4 (permalink)  
Old 09-28-2005, 03:29 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default Re: gcc linking error

Quote:
Originally Posted by kavi
gcc sample.c -o sample -lvga.c
Look like your command is not correct, try following compile command:

Code:
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -g -I../include -I../gl   -o sample sample.c  -lvgagl -lvga
Let me know if this works on not!
Reply With Quote
  #5 (permalink)  
Old 09-28-2005, 11:35 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Also, you may need to configure file /etc/vga/libvga.config. It is Configuration file for svgalib.
If you don't have root level access then Other config file locations is ~/.svgalibrc i.e. /home/yourname/.svgalibrc. If you need to see examples then they are located in /usr/share/doc/svgalib/examples/
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #6 (permalink)  
Old 09-29-2005, 03:01 AM
Junior Member
User
 
Join Date: Sep 2005
Posts: 24
Rep Power: 0
kavi
Default Re: gcc linking error

Quote:
Originally Posted by monk
Quote:
Originally Posted by kavi
gcc sample.c -o sample -lvga.c
Look like your command is not correct, try following compile command:

Code:
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -g -I../include -I../gl   -o sample sample.c  -lvgagl -lvga
Let me know if this works on not!
Hi Monk,
that did not work. btw my apologies there is no -lvga.c. i did not use the .c
the cc -Wall............
did not work. it still gave the same error.
Reply With Quote
  #7 (permalink)  
Old 09-29-2005, 03:03 AM
Junior Member
User
 
Join Date: Sep 2005
Posts: 24
Rep Power: 0
kavi
Default

Quote:
Originally Posted by nixcraft
Also, you may need to configure file /etc/vga/libvga.config. It is Configuration file for svgalib.
If you don't have root level access then Other config file locations is ~/.svgalibrc i.e. /home/yourname/.svgalibrc. If you need to see examples then they are located in /usr/share/doc/svgalib/examples/
well something seems to be wrong with the installation. Even as root i did not find the folder vga in /etc. and whats more i am searching for .svgalibrc file !!
Reply With Quote
  #8 (permalink)  
Old 09-29-2005, 09:48 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default

Thanks monk it is working now.. at least I'm able to compile program... but this library is not so good... i mean it is not working the way my BC/TC graphics program works. May be I need to configure something.. not sure... any other good graphic library ?
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
  #9 (permalink)  
Old 09-30-2005, 02:14 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

kavi, look like you don't have svgalib installed...btw you got which distro? If it is debain then use following command to install it:
Code:
apt-get install svgalib-bin
Reply With Quote
  #10 (permalink)  
Old 09-30-2005, 06:25 AM
Junior Member
User
 
Join Date: Sep 2005
Posts: 24
Rep Power: 0
kavi
Default

i use FC3. perhaps u r right. its not installed well. let me see this weekend. right now got something else to do.
thanx though, will let u know if i work it out.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Library Linking in GCC newbie-wan Coding in General 1 10-18-2006 03:28 AM
Invalid ICMP type 3 code 3 error to a broadcast -samba error raj Linux software 0 07-09-2006 05:38 AM


All times are GMT +5.5. The time now is 03:53 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36