Boost logo

Boost Users :

Subject: [Boost-users] boost::math function link problem
From: joe claire (bluette.turtle_at_[hidden])
Date: 2009-08-22 00:41:59


Hi all,

I am new to boost library.

First of all, I apologize that my question will be pretty basic to people in
this mailing list,
nevertheless I have spent 30 min + to figure it out and couldn't find the
answer.
So, here it goes...

I need to find which library (lib*.a) file contains the "ibeta" function
which is defined under
boost/math/special_functions/gamma.hpp.

When I compile the following simple test.cpp
-----------------------------------------
#include <boost/math/special_functions/gamma.hpp>
#include <iostream>

using namespace std;
using namespace boost::math;

int main() {
  cout << "it is my birthday...\n";
  cout << ibeta(5, 2, 0.5) << "\n";
}
-----------------------------------------

with this command line,

g++ -I /my_own_boost_root_path/ test.cpp

I get link error message (undefined reference)

/tmp/ccgrrT4l.o: In function `main':
test.cpp:(.text+0xc1): undefined reference to
`boost::math::tools::promote_args<int, int, double, float, float,
float>::type boost::math::ibeta<int, int, double>(int, int, double)'
collect2: ld returned 1 exit status

I know that I just need to put the correct library in the command line, but
I can't figure it out.

There are 6 lib*.a files in
boost_build_dir/bin.vs/libs/math/build/gcc-4.1.2/release/link-static/threading-multi/

I tried to each of them at the end of my compilation command line, in the
hope that "ibeta" is contained in one of them, but I failed.

1. Where should I look to find the lib*.a that contains "ibeta" (ibeta is
incomplete beta function integral)
2. In general, how do I figure out which lib*.a to use, when I need to use
specific classes or functions?
   (I have looked at "getting started", and "libraries" for proper
documentation, but they explain in detail
    the available libraries, but, not what lib*.a file to use for specific
functions...)
3. Is it possible that "ibeta" is not built

Thanks a lot !



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