make [2]:***没有规则来制作目标`/usr/lib/i386-linux-gnu/libmpfr.so'在CGAL

时间:2015-03-30 07:51:12

标签: c++ linux cgal

我正在使用CGAL,我有这个最小的例子(应该没问题,因为它是一个例子):

#include <iostream>
#include <vector>
#include <CGAL/Cartesian_d.h>
#include <CGAL/point_generators_d.h>
typedef CGAL::Cartesian_d<double> Kd;
typedef Kd::Point_d Point;
typedef CGAL::Creator_uniform_d<std::vector<double>::iterator, Point>Creator_d;
int main ()
{
  int nb_points = 10;
  int dim =5;
  double size = 100.0;
  std::cout << "Generating "<<nb_points<<" random points in a"
    <<" ball in "<<dim<<"D of center 0 and radius "<<size<<std::endl;
  std::vector<Point> v;
  v.reserve (nb_points);
  CGAL::Random_points_in_ball_d<Point> gen (dim, 100.0);
  for (int i = 0; i < nb_points; ++i) v.push_back (*gen++);
  for (int i = 0; i < nb_points; ++i) std::cout<<" "<<v[i]<<std::endl;
  return 0;
}

但是,我收到此错误:

samaras@samaras-A15:~/code/random_generator$ make
Scanning dependencies of target main
[100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
make[2]: *** No rule to make target `/usr/lib/i386-linux-gnu/libmpfr.so', needed by `main'.  Stop.
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2

我应该做什么?

我正在创建这样的CmakeLists文件:

~/code/CGAL-4.3/scripts/cgal_create_CMakeLists
cmake -DCGAL_DIR=$HOME/code/CGAL-4.3 .

正如我所描述的here

如果您需要更多信息,请告诉我们。

-

cd /usr/lib/i386-linux-gnu/libmpfr.so
bash: cd: /usr/lib/i386-linux-gnu/libmpfr.so: No such file or directory

2 个答案:

答案 0 :(得分:3)

在Debian或Ubuntu上安装CGAL的最简单方法是apt-get install libcgal-dev(或libcgal-qt4-dev)。如果您打算自己构建CGAL,您仍应apt-get build-dep cgal安装最相关的依赖项。

答案 1 :(得分:1)

毕竟图书馆遗失了,所以我这样做了,我们没事:

sudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg

Source