GCC (linking) was barfing that it could not find a library when specified with an absolute path. Note the reason I want this is I have a build system that keeps all libraries resolved by absolute path so it can keep an ordered set of unique entries.
g++ (...) -l/path/to/library.so
I saw a bug report where some people thought it was a bug, and others thought the fact it ever worked was a bug, and it was fixed.
There was some discussion that one had to precede the path with a ':'
Anyway didn't make it work.
So to test in the build system I put code in to truncate the absolute library path if it's "prefix" matched any of the library paths specified to GCC and truncate the absolute library path.
g++ (...) -L/path/to -llibrary.so
This worked.
I also tried this.
g++ (...) -L/path/to -l/path/to/library.so
and it worked. 9 (though investigating .. looks like this was an error in the build script )
It seems possibly if any of the search paths specified for GCC are a "prefix" to a library specified with an absolute path it finds the library. I would also assume it takes the first hit in the ordered list of library paths supplied.
So my questions.
- Is this supported behavior?
- Is it better in this to truncate the absolute library path in the build script or pass in the absolute path.
I notices some related issues brought up here:
This indicates a "non searched" full path is "burned in" to an executable thus overriding any runtime library path when it is executed? Is this correct ? If so it means specifying the library with the full path on the command line is not appropriate. On deployment the built app and associated libraries would be installed in standard searchable locations.