From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199611120452.WAA27204@atheist.tamu.edu> Date: Mon, 11 Nov 1996 22:52:37 -0600 (CST) From: Richard Henderson Subject: Re: GCC linker error... Help? 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 .so -Wl,--whole-archive .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= 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