Just can't stay away
Joined: 2009/4/28 4:57 Last Login
: Yesterday 12:51
From Adelaide, Australia
Group:
Registered Users
|
That means that in the linking line, it's trying to link against the .so instead of the .a
You should be able to just use --disable-shared to solve all of that (although a .so will not be generated).
This is what is happening:
1) Program/library not configured with --disable-shared 2) Program/library uses libtool for building the library/binaries. 3) libtool loads an .la of a dependent lib, and finds that a .so is referenced. 4) libtool tries building the binary using the .so. 5) -use-dynld is missing while trying to use a .so, hence the error appears.
Often it's enough to just copy & paste the last linking line (from the word "gcc" onwards) and change .so to .a where you can see it.
Just some more miscellaneous info:
By default, usually static & shared are enabled. This results in .o files in .libs/ (-fPIC) and .o files in the parent dir (without -fPIC). The ones in .libs/ are used to make the .so, the ones in the parent dir are used to make the .a
In my experience, object files (.o) belonging to binaries/executables should be built without -fPIC, regardless of whether you're linking against a .so or not. Fortunately libtool handles this properly, so you only get one .o per .c for the executables. I've seen issues where some makefiles just build absolutely everything with -fPIC (not just the content for the .so), and the shared-lib executables won't work.
Also if you want proper version numbers for your .so, you need to edit libtool and change version_type to freebsd-elf and deplibs_check_method to pass_all (although SDL/SDL2 might be exceptions since they include the version number prior to the file extension anyway).
Edited by MickJT on 2016/2/29 10:34:25 Edited by MickJT on 2016/2/29 10:38:04 Edited by MickJT on 2016/2/29 10:40:53 Edited by MickJT on 2016/2/29 10:42:29 Edited by MickJT on 2016/2/29 10:52:03 Edited by MickJT on 2016/2/29 10:55:26 Edited by MickJT on 2016/3/3 17:13:12 Edited by MickJT on 2016/3/3 17:13:53
|