Results 1 to 10 of 10

Thread: gcc linking error

  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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?

  2. #2
    Contributors sweta's Avatar
    Join Date
    Feb 2005
    Location
    New Delhi
    Posts
    225
    Thanks
    20
    Thanked 12 Times in 12 Posts
    Rep Power
    12

    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

  3. #3
    Junior Member
    Join Date
    Sep 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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......

  4. #4
    Senior Member monk's Avatar
    Join Date
    Jan 2005
    Location
    Tibet
    Posts
    643
    Thanks
    5
    Thanked 43 Times in 38 Posts
    Rep Power
    15

    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!

  5. #5
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,500
    Thanks
    17
    Thanked 790 Times in 507 Posts
    Rep Power
    10

    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/
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  6. #6
    Junior Member
    Join Date
    Sep 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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.

  7. #7
    Junior Member
    Join Date
    Sep 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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 !!

  8. #8
    Contributors sweta's Avatar
    Join Date
    Feb 2005
    Location
    New Delhi
    Posts
    225
    Thanks
    20
    Thanked 12 Times in 12 Posts
    Rep Power
    12

    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 ?

  9. #9
    Senior Member monk's Avatar
    Join Date
    Jan 2005
    Location
    Tibet
    Posts
    643
    Thanks
    5
    Thanked 43 Times in 38 Posts
    Rep Power
    15

    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

  10. #10
    Junior Member
    Join Date
    Sep 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Library Linking in GCC
    By newbie-wan in forum Coding in General
    Replies: 1
    Last Post: 18th October 2006, 02:28 AM
  2. Replies: 0
    Last Post: 9th July 2006, 04:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •