| [ Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]
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 |
Version: | 1.1-current |
Created By: | larry.finger.lwfinger |
Assigned To: | mike |
Fix Version: | 1.1-current (SVN: v5988) |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#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,libfltk.so.1.1 -ldl -lm -lXext -lX11 -shared -fPIC -o libfltk.so.1.1 ... /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. | |
[ Return to Bugs & Features ]
|
| |