Boost logo

Boost Users :

From: Steven Mackenzie (boost_at_[hidden])
Date: 2007-07-16 07:49:45


Hello,

The build steps (./configure, make ...) are pretty much what I did a few days
ago, and it works fine for me on RedHat/CentOS 4.

You have Boost 1.32 installed (the system default), and 1.34 installed in your
personal area, right? So probably you are also running something a bit like
Redhat Linux 4 ...

I needed to do 3 things to complie and link against the new libraries:

1/ Make sure my compiler checks the new include path for headers before the
system defaults - look in /home/ChandanNilange/work/boost/include/boost-1_34 -
are there headers there? That path needs to be before /usr/include. For gcc/g++
that requires a -I option to the compiler.

2/ Make sure that my linker knows where the new libraries are - look in
/home/ChandanNilange/work/boost/lib, and if that is full of libraries, then use
-L to state the path

3/ Change the names of the libraries that you are trying to link to; for example
  I used to link to boost_regex, now I link to boost_regex-gcc34-mt-1_34 (I use
the -mt version because my app is multi-threaded and also links to pthread).

Then to run the application the library loader also needs to know where your new
libraries are. I added the install directory of the new Boost libs to
/etc/ld.so.conf, but I think that you can also use the environment variable
LD_LIBRARY_PATH. (Search for the Program Library HOWTO if you need more
information about that).

Chandan Nilange wrote:
> Hello John,
>
> I find following *.a *.so but no libboost_regex.so
> at path :/home/ChandanNilange/work/boost/lib
>
> libboost_regex-gcc34-1_34.a
> libboost_regex-gcc34-1_34.so
> libboost_regex-gcc34-1_34.so.1.34.0
> libboost_regex-gcc34.a
> libboost_regex-gcc34-d-1_34.a
> libboost_regex-gcc34-d-1_34.so
> libboost_regex-gcc34-d-1_34.so.1.34.0
> libboost_regex-gcc34-d.a
> libboost_regex-gcc34-d.so
> libboost_regex-gcc34-mt-1_34.a
> libboost_regex-gcc34-mt-1_34.so
> libboost_regex-gcc34-mt-1_34.so.1.34.0
> libboost_regex-gcc34-mt.a
> libboost_regex-gcc34-mt-d-1_34.a
> libboost_regex-gcc34-mt-d-1_34.so
> libboost_regex-gcc34-mt-d-1_34.so.1.34.0
> libboost_regex-gcc34-mt-d.a
> libboost_regex-gcc34-mt-d.so
> libboost_regex-gcc34-mt.so
> libboost_regex-gcc34.so
>
> Also, I tried with all above *.a by stripping "lib" &
> .* from their name. However I can get messages like
>
> /usr/include/boost/regex/v4/basic_regex.hpp:338:
> undefined reference to `boost::reg_expression<char,
> boost::regex_traits<char>, std::allocator<char>
>> ::reg_expression(std::allocator<char> const&)'
>
> Do you think I have made some mistake during build.
> Following were the steps followed
> => gunzip boost_1_34_0.tar.gz
> => tar -xvf boost_1_34_0.tar
> => cd boost_1_34_0
> => ./configure
> --prefix=/home/ChandanNilange/work/boost/
> --with-libraries=regex
> => make install
>
> Regards,
> Chandan
>
> --- John Maddock <john_at_[hidden]> wrote:
>
>> Chandan Nilange wrote:
>>> Hello,
>>>
>>> I have boost_1_32 version installed at
>>> /usr/include/boost
>>> Also, I have installed boost_1_34 at another
>>> path:/home/myname/work/boost/boost_1_34_0/
>>>
>>> Now when I try to run with 1_34 version, it still
>>> points to 1_32 version at /usr/include (this is
>>> observed when I debug using gdb it refers to
>>> /usr/include/boost/regex/v4/match_results.hpp:118)
>>>
>>> I tried following things:
>>>
>>> 1]
>>> export
>>>
> LD_LIBRARY_PATH=/home/myname/work/boost/boost_1_34_0/boost:$LD_LIBRARY_PATH
>>> export
>>>
> PATH=/home/myname/work/boost/boost_1_34_0/boost:$PATH
>> Looks right.
>>
>>> 2]
>>> I am using following command for compilation
>>> g++ -c -g
>> -I/home/myname/work/boost/boost_1_34_0/boost
>>> ${TEST_FILES_PATH}/${TEST}.c
>>> g++ ${TEST}.o -L/home/myname/work/boost/lib
>>> -lboost_regex
>> Looks right: you could double check by checking the
>> value of BOOST_VERSION
>> in your code, and verifying that libboost_regex.so
>> is present in
>> /home/myname/work/boost/lib.
>>
>>> 3] I am including boost header in ${TEST}.c as
>> below
>>> #include "boost/regex.hpp"
>> Also looks right.
>>
>> Basically you have three things to double check:
>>
>> 1) Compile time, that the right headers are
>> included.
>> 2) Link time, that you're linking against the right
>> library.
>> 3) Run time, that LD_LIBRARY_PATH is set right.
>>
>> Personnally if I were a better man, I'd put a bet on
>> #2, but that's just a
>> guess :-)
>>
>> HTH, John.
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>>
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
> ____________________________________________________________________________________
> Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net