Hi,

I'm building a program that links against boost with libtool.

The boost library is installed on the system and is a shared library.

When i run my program ./test_suite I get,
$ ./test_suite 
.../build/.libs/lt-test_suite: error while loading shared libraries: 
libboost_filesystem.so.1.53.0: cannot open shared object file: No such file or 
directory

My Makefile looks like,

noinst_PROGRAMS += test_suite

test_suite_SOURCES = \
    src/progs/test_suite/fixture.cpp \
    src/progs/test_suite/main.cpp

test_suite_CPPFLAGS = \
    @BOOST_CPPFLAGS@

test_suite_LDFLAGS = \
    @BOOST_LDFLAGS@

test_suite_LDADD = \
    @BOOST_LIBS@

Where the boost variables are,
BOOST_CPPFLAGS = -IBOOSTDIR/boost_1_53_0_prefix/include
BOOST_LDFLAGS = -LBOOSTDIR/boost_1_53_0_prefix/lib
BOOST_LIBS = -lboost_filesystem -lboost_system

I have a few questions.

For linking against system libraries, is using LDFLAGS and LDADD
appropriate the way I have done it?

Is it my responsibility to add the -rpath libtool option to include
BOOSTDIR/boost_1_53_0_prefix/lib?

Should I be setting LD_LIBRARY_PATH when running from the build
directory?

I notice that when I link against libtool created libraries in the
same Makefile I don't see this issue at all.

Thanks,
Bob

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to