From: Richard Henderson <richard@atheist.tamu.edu>
Subject: Re: GCC linker error... Help?
Date: Mon, 11 Nov 1996 22:52:37 -0600 (CST) [thread overview]
Message-ID: <199611120452.WAA27204@atheist.tamu.edu> (raw)
In-Reply-To: <199611120130.UAA11375@system1.virginia.edu>
> I am trying to compile the VTK, a mesa program for data
> visualization, and have run into a problem I wondered if anyone else new
> about.
[...]
> c++ -o vtk tkAppInit.o vtkAutoInit.o vtkTclUtil.o \
> -L. -lvtkTcl vtkXRenderWindowInteractor.o \
> -L../src -lvtk -L/usr/X11R6/lib -lGL /usr/lib/libtk.so /usr/lib/libtcl.so
> -ldl -L/usr/X11R6/lib -lXext -lXt -lSM -lICE -lX11 -lm
> /usr/lib/gcc-lib/alpha-linux/2.7.2/crtend.o(.text+0x14): relocation truncated
> to fit: LITERAL __CTOR_END__
[...]
> tclvtkProperty.hh.cc(.text+0x4a5c): relocation truncated to fit: LITERAL $C229
There are two possible problems:
1) less likely, you are mixing ELF and ECOFF object files or libraries.
2) you've run into a limit in the current ELF linker in the size of the
.got section (which is related to the number of global variables and
functions in the program).
Assuming the second, there is a way that you can work around the problem
right now: turn some of your static libraries into shared libraries.
From your link line, there appear to be three likely candidates:
-lvtkTcl, -lvtk, and -lGL. The link line for doing that is
gcc -shared -o <library>.so -Wl,--whole-archive <library>.a \
-Wl,--no-whole-archive
Now you have three options: (1) you can either put the newly created
shared libraries in one of the standard library directories, (2) if
you have a dedicated directory heirarchy for your application (e.g.
/usr/local/vtk/) you can put them in /usr/local/vtk/lib and add that
to your /etc/ld.so.conf, or (3) you can pick a directory (usually
the one the executable resides in) and add -Wl,-rpath=<directory> to
the link line _for the executable_.
r~
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next parent reply other threads:[~1996-11-12 4:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199611120130.UAA11375@system1.virginia.edu>
1996-11-12 4:52 ` Richard Henderson [this message]
1996-11-12 1:30 GCC linker error... Help? Hunter Andreas Ware
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox