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

Re: Compile failure libGL.a



Þann Laugardagur 25. mars 2006 11:47 skrifaði Kurt Roeckx:
> On Sat, Mar 25, 2006 at 11:03:47AM +0100, Gudjon I. Gudjonsson wrote:
> > Hi
> >    Has anyone had the following problem when compiling C++ programs:
> > "/usr/X11R6/lib/libGL.a: could not read symbols: Bad value"
> > I found this on the internet which is the same problem in Ubuntu.
> > http://www.cegui.org.uk/mantis/view.php?id=7
> > But my question is the following. Assuming the problem stems from libGL.a
> > not having been compiled with the -fPIC option. Can I recompile it safely
> > with this option? I downloaded the Debian version of
> > xorg-x11-6.9.0.dfsg.1 but decided to ask the list before continuing.
>
> My guess is that you're trying to link libGL.a which is a
> static library, and therefor not build with -fPIC, into a shared
> library, which needs to be build with -fPIC.
>
> Instead of /usr/X11R6/lib/libGL.a, you need to link to
> /usr/X11R6/lib/libGL.so.
>
> Both are be part of xlibmesa-gl-dev.
>
> I have no idea why you try to link the static version, but you
> shouldn't.
>
>
> Kurt
Thank you Kurt for your answer. Unfortunately I don't understand how to apply 
your answer since I am trying to create a shared library. It is the library 
qwtplot3d. These are the last lines of the compilation messages I get.

test -d lib/ || mkdir -p lib/
rm -f libqwtplot3d.so.0.3.0 libqwtplot3d.so libqwtplot3d.so.0 
libqwtplot3d.so.0.3
g++ -shared -Wl,-soname,libqwtplot3d.so.0 -o libqwtplot3d.so.0.3.0 
tmp/qwt3d_axis.o tmp/qwt3d_color.o tmp/qwt3d_coordsys.o tmp/qwt3d_data.o 
tmp/qwt3d_drawable.o tmp/qwt3d_lighting.o tmp/qwt3d_colorlegend.o 
tmp/qwt3d_extglwidget.o tmp/qwt3d_plot.o tmp/qwt3d_label.o tmp/qwt3d_types.o 
tmp/qwt3d_enrichment_std.o tmp/qwt3d_autoscaler.o tmp/qwt3d_io_reader.o 
tmp/qwt3d_io.o tmp/qwt3d_scale.o tmp/qwt3d_gridmapping.o 
tmp/qwt3d_parametricsurface.o tmp/qwt3d_function.o tmp/qwt3d_surfaceplot.o 
tmp/qwt3d_gridplot.o tmp/qwt3d_meshplot.o tmp/qwt3d_io_gl2ps.o tmp/gl2ps.o 
tmp/moc_qwt3d_extglwidget.o tmp/moc_qwt3d_plot.o tmp/moc_qwt3d_surfaceplot.o  
-L/usr/share/qt3/lib -L/usr/X11R6/lib -lz -lqt-mt -lGLU -lGL -lXmu -lpthread
/usr/bin/ld: /usr/X11R6/lib/libGL.a(glapi.o): relocation R_X86_64_32 against 
`a local symbol' can not be used when making a shared object; recompile with 
-fPIC
/usr/X11R6/lib/libGL.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [lib/libqwtplot3d.so.0.3.0] Error 1

Regards
Gudjon














Reply to: