first post

Search this archive.

From: Tom Nicholson Local (tomn@hughes.net)
Date: Sun 05 Nov 2000 - 08:55:03 IST


Greetings everyone, and sorry but my first post here is regarding some
problems I had installing and compiling on Mandrake 7.1. I'm doing this in
the hope that by documenting it we will help someone else. On the web
mailing list archive I saw that my problems were nearly the same as another
post. A thank-you to Matan Ziv-Av for the solution.

./sample: error in loading shared libraries: libvga.so.1: cannot open shared
object file: no such file or directory

Kevin D. Quitt's "Demos with static libs require shared libs?"  Following
the suggestion in the answer by Matan Ziv-Av, I put symbolic links where I
thought they should be, but that didn't work. I finally noticed he mentioned
a program ldconfig that should have run (with the make install script I
presume). I ran it and it fixed things for me. sample.c (first thing in the
tutorial online) finally ran. I'm clueless what it did, but I have a couple
theories and if anyone could let me know what's up I'd appreciate it:

1) that Mandrake (or RedHat) moved the location of the library from where
svgalib is expected to be; or symlinks moved where they're not supposed to
be; or
2) I'm dealing with a libc5 vs. libc6 issue

I'm totally new to svgalib, but not to c programming. Many years with c and
asm. (I still have my original MS/Lattice c compiler v.1 from the 80's).
Relatively new to Linux. I expected some learning curve and frustration.

Here are the steps I took.
1. copy the sample code from tutorial.
#include <stdlib.h>
#include <vga.h>

int main(void)
{
   vga_init();
   vga_setmode(G320x200x256);
   vga_setcolor(4);
   vga_drawpixel(10, 10);

   sleep(5);
   vga_setmode(TEXT);
   return 0;
}
gcc -O3 -o sample sample.c -lvga

This wouldn't compile at all. gcc said there were no declarations for TEXT
and G320x200x256. I found that my vga.h was something different from
svgalib's vga.h so I put the svgalib vga header file in the /root directory
and it still refused to compile. Yes, changed <vga.h> to "vga.h" too.

2. I decided next to try compiling the source so I d/l'ed source for 1.4.2
from svgalib.org site, extracted and make install'ed it. First make bombed
because it tried to put something in /usr/local/include and there was no
such directory as include under /usr/local. So I created the include dir and
re-compiled. This time everything seemed ok. Various warnings from time to
time but no errors that I saw.

3. Re-compiled sample.c and compiling worked, but execution failed with
message above. I also ---

4. Read the docs and web faq.
5. Verified that ./sample is chmod +x (I'm working as root from paranoia.)
6. Looked at the mailing list archive.
7. Ran ldconfig.

I'm hoping to use svgalib to write an introductory graphics programming
language aimed at education audiences for ages 9-13.

Thanks,
Tom Nicholson






------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST