nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-09-2005, 08:58 AM
Junior Member
User
 
Join Date: Sep 2005
OS: suse/redhat
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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
  #2 (permalink)  
Old 27-09-2005, 06:48 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
OS: Suse, RHEL, Vista
Posts: 199
Thanks: 12
Thanked 9 Times in 9 Posts
Rep Power: 7
sweta has a spectacular aura about sweta has a spectacular aura about
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
__________________
Reply With Quote
  #3 (permalink)  
Old 28-09-2005, 08:25 AM
Junior Member
User
 
Join Date: Sep 2005
OS: suse/redhat
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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 28-09-2005, 02:29 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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 28-09-2005, 10:35 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
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 Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #6 (permalink)  
Old 29-09-2005, 02:01 AM
Junior Member
User
 
Join Date: Sep 2005
OS: suse/redhat
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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 29-09-2005, 02:03 AM
Junior Member
User
 
Join Date: Sep 2005
OS: suse/redhat
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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 29-09-2005, 08:48 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
OS: Suse, RHEL, Vista
Posts: 199
Thanks: 12
Thanked 9 Times in 9 Posts
Rep Power: 7
sweta has a spectacular aura about sweta has a spectacular aura about
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 ?
__________________
Reply With Quote
  #9 (permalink)  
Old 30-09-2005, 01:14 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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 30-09-2005, 05:25 AM
Junior Member
User
 
Join Date: Sep 2005
OS: suse/redhat
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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


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 Off


Similar Threads

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


All times are GMT +5.5. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38