[odb-users] RE: Linux Linking ODB - libtool vs g++

Dan Coffey dcoffey at netharmonix.com
Mon Aug 29 13:45:33 EDT 2011


Here is a link that shows you how to setup Ubuntu files in 
/etc/ld.so.conf.d 
<http://askubuntu.com/questions/9878/set-ld-library-path-for-applications-started-from-the-desktop>
so that the libs will be found.

Dan

On 08/29/2011 01:01 PM, Boris Kolpackov wrote:
> Hi Thomas,
>
> Szumowski, Thomas<thomas.szumowski at lmco.com>  writes:
>
>> I noticed the main difference between the libtool and g++ calls were
>> libtools inclusion of "-Wl,-rpath,/usr/local/lib". Adding that to g++
>> and naturally it works fine. So perhaps I just need to ensure I have
>> that added in as needed?
> Hm, this gets stranger. Here is a quote from the GNU ld man pages that
> may explain why this helps:
>
> "The -rpath option is also used when locating shared objects which are
>   needed by shared objects explicitly included in the link"
>
> So it seems like for some reason ld cannot locate libsqlite3.so (which
> I assume is in /usr/local/lib) even though it can resolve -lodb-sqlite
> and -lodb without any problems. Very strange.
>
> Can you try this:
>
> $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
>
> And then run the vanilla g++ command?
>
> As well as this (without the LD_LIBRARY_PATH):
>
> $ g++ -L/usr/local/lib ...
>
> Boris
>


More information about the odb-users mailing list