Mailing List Archive

Support open source code!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: gcc use

Alberto Tomita wrote:
> > Hi, I'm a newbie in linux (just installed Vine Linux last week).
> >  Well, I wanted to learn OpenGL programming, so I downloaded stuffs like
> >  GL lib and include files from MESA site. The HOWTO says that I'm
> >  supposed to copy all the GLlib and includes in /usr/local/lib and
> >  /usr/local/includes respectively.  Then I tested with demos and they
> >  didn't run.. So I copied the lib and includes again from the original
> >  to /usr/lib and /usr/includes. And this time, it worked fine. All the
> >  demos (except ones which need hardware acceleration) ran.
> There are two different issues: error at runtime and error at compilation
> time.
> The first can be solved by indicating the path to the dynamic libraries.
> Edit your /etc/ and add a line pointing to /usr/local/lib.
> Mine looks like:
>    /usr/X11R6/lib
>    /usr/lib
>    /usr/i486-linux-libc5/lib
>    /usr/local/lib
> To compile including the new libraries, you have to tell gcc not only
> which ones to include (as someone already wrote) but also where to
> find them. Give the path to the libraries with the -L option:
>    gcc ... -L/usr/local/lib ...
> If it still doesn't work, please post again to the TLUG list telling us
> what happened.

   First of all, thanks for the advice.

   Well, interestingly it still didn't work after I edited
to include "/usr/local/lib" (after I erased the lib and includes from
/usr/lib ). When I tried to run the demo, it returned:
$ ./gears
./gears: error in loading shared libraries cannot open shared object file: No such file or directory

   Hmm, I don't know why...   The demos only run when I put all the lib
and includes in /usr/lib, but not /usr/local/lib.  Is there anything
I'm supposed to do after editing /etc/ (Well, I guess it's
since it runs using /usr/lib)

   And compiling doesn't work either.  Here's the result:
$ gcc -o hello hello.c -lMesaGLU -lMesaGL -lXext -lXmu -lX11 -lm
ld: cannot open -lXext: No such file or directory

$ gcc -L/usr/lib hello.c -lMesaGLU -lMesaGL -lXext -lXmu -lX11 -lm
ld: cannot open -lXext: No such file or directory

Munenari Fukuda                           "Methodology, like sex,is
School of Engineering & Applied Science    better demonstrated than
University of Pennsylvania                 discussed, though often
e-mail :          better anticipated than
address: Box 747, Harrison                 experienced."
         3910 Irving Street                   --Edward Leamer
         Philadelphia, PA 19104
Next Technical Meeting: October 9 (Sat), 13:30   place: Temple Univ.
* Linux Internationalisation Initiative (Li18nux) speaker: Akio Kido
* Japanese TrueType Fonts                     speaker: Adrian Havill
Next Technical Meeting: November 13 (Sat), 13:30 place: Temple Univ.
* Network Security                               speaker: Steve Baur
Next Nomikai:  December 17 (Fri), 19:00 Tengu TokyoEkiMae 03-3275-3691
more info:        Sponsor: Global Online Japan

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links