Please help: Getting started with Boost

I have a 64 bit red hat linux (also 64 bit) box. 1) I downloaded boost from boost_1_34_1.tar.bz2 <http://downloads.sourceforge.net/boost/boost_1_34_1.tar.bz2?modtime=1185241 108&big_mirror=0> 2) Unizipped and installed it (./configure , make install ) everything worked fine. Questions: 1) How do I check if I now have the 64 bit version of boost? 2) I see that all libraries were put into /usr/local/lib and I can compile my hello world code with the following command. * $ g++ hello.cpp -lboost_thread-gcc41-mt-1_34_1 but when I try to run the created a.out file I get a file not found error msg. * $ ./a.out * ./a.out: error while loading shared libraries: libboost_thread-gcc41-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory I did an ldd and this is the output. $ ldd a.out libboost_thread-gcc41-mt-1_34_1.so.1.34.1 => not found libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003a6aa00000) libm.so.6 => /lib64/libm.so.6 (0x0000003a5a400000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003a68600000) libc.so.6 => /lib64/libc.so.6 (0x0000003a5a000000) /lib64/ld-linux-x86-64.so.2 (0x0000003a59c00000) I am stuck and cannot make progress. I appreciate any help on this. Thanks Nishant

Nishant Mittal wrote:
I have a 64 bit red hat linux (also 64 bit) box.
1) I downloaded boost from
boost_1_34_1.tar.bz2 <http://downloads.sourceforge.net/boost/boost_1_34_1.tar.bz2?modtime=1185241 108&big_mirror=0>
2) Unizipped and installed it (./configure , make install ) everything worked fine.
Questions:
[Well, neither question is actually a question about Boost, but anyway]
1) How do I check if I now have the 64 bit version of boost?
file <any-library-file> should produce output such as: <library>: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), stripped You can also use readelf -h <any-library-file>
2) I see that all libraries were put into /usr/local/lib and I can compile my hello world code with the following command.
* $ g++ hello.cpp -lboost_thread-gcc41-mt-1_34_1
but when I try to run the created a.out file I get a file not found error msg.
* $ ./a.out
* ./a.out: error while loading shared libraries: libboost_thread-gcc41-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory
I did an ldd and this is the output.
$ ldd a.out
libboost_thread-gcc41-mt-1_34_1.so.1.34.1 => not found
You should add /usr/local/lib to LD_LIBRARY_PATH environment variable. - Volodya

Thanks Volodya.
1) LD_LIBRARY_PATH solution worked but now when I run a.out, I get a
Segmentation fault.
My hello world code is...
#include <iostream>
#include
I have a 64 bit red hat linux (also 64 bit) box.
1) I downloaded boost from
boost_1_34_1.tar.bz2
<http://downloads.sourceforge.net/boost/boost_1_34_1.tar.bz2?modtime=1185241
108&big_mirror=0>
2) Unizipped and installed it (./configure , make install ) everything worked fine.
Questions:
[Well, neither question is actually a question about Boost, but anyway]
1) How do I check if I now have the 64 bit version of boost?
file <any-library-file> should produce output such as: <library>: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), stripped You can also use readelf -h <any-library-file>
2) I see that all libraries were put into /usr/local/lib and I can compile my hello world code with the following command.
* $ g++ hello.cpp -lboost_thread-gcc41-mt-1_34_1
but when I try to run the created a.out file I get a file not found error msg.
* $ ./a.out
* ./a.out: error while loading shared libraries: libboost_thread-gcc41-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory
I did an ldd and this is the output.
$ ldd a.out
libboost_thread-gcc41-mt-1_34_1.so.1.34.1 => not found
You should add /usr/local/lib to LD_LIBRARY_PATH environment variable. - Volodya _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Nishant Mittal wrote:
Thanks Volodya. 1) LD_LIBRARY_PATH solution worked but now when I run a.out, I get a Segmentation fault.
My hello world code is...
[snip] There's nothing suspicious in your code. You need to get a backtrace, and probably poke around in debugger to figure out what exactly goes wrong. - Volodya
participants (2)
-
Nishant Mittal
-
Vladimir Prus