我正在使用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 .
正如我在这里所描述的。
如果你需要更多信息,请告诉我。
--
cd /usr/lib/i386-linux-gnu/libmpfr.so
bash: cd: /usr/lib/i386-linux-gnu/libmpfr.so: No such file or directory
在Debian或Ubuntu上安装CGAL最简单的方法是apt-get install libcgal-dev
(或libcgal-qt4-dev
)。如果您要自己构建CGAL,您仍然应该安装最相关的依赖项apt-get build-dep cgal
。
库毕竟不见了,所以我这样做了,我们没事:
sudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg
源