STR #1791

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]

Return to Bugs & Features | Roadmap 1.1 ]

STR #1791

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:2 - Specific to an operating system
Subsystem:Build Files
Summary:Error when building shared libraries on Linux
Created By:larry.finger.lwfinger
Assigned To:mike
Fix Version:1.1-current (SVN: v5988)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files

Trouble Report Comments:

Name/Time/Date Text top right image
#1 larry.finger.lwfinger
14:53 Sep 24, 2007
When building FLTK 1.1 with shared libraries, I get the following error message:

g++ -L/usr/lib64 -Wl,-soname, -ldl -lm -lXext -lX11 -shared -fPIC -o ...
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: Fl.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
Fl.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

This error occurred with the latest svn (r5490), g++ (GCC) 4.2.1 (SUSE Linux) on x86_64.

The problem is that when linking an so, /usr/lib64 is used in the -L switch, but that directory contains an old, non PIC version of libfltk.a.

The fix (for me) was to change DSOFLAGS in makeinclude as follows:

Index: fltk-1.1/makeinclude
--- fltk-1.1.orig/makeinclude
+++ fltk-1.1/makeinclude
@@ -74,7 +74,7 @@ DSOCOMMAND    = $(CXX) $(DSOFLAGS) -Wl,-son

 # libraries to link with:
 AUDIOLIBS      = -lasound
-DSOFLAGS       =  -L/usr/lib64
+DSOFLAGS       =  -L.
 LDFLAGS                = $(OPTIM)  -L/usr/lib64
 LDLIBS         = -ldl -lm  -lXext -lX11
 GLDLIBS                = -lGLU -lGL -ldl -lm  -lXext -lX11

This is just a hack as the real change needs to be made in the configure scripts and/or data files, but I must leave those for someone that understands them.
#2 mike
05:16 Sep 25, 2007
Reassigning to 1.1.x...  
#3 mike
20:43 Nov 20, 2007
Fixed in Subversion repository.  
bottom left image   bottom right image

Return to Bugs & Features ]


Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.