- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我发现 CGAL
示例无法在 Mac OS X 10.9 (Mavericks) 下编译。您可以成功编译主要的 CGAL 4.3
库并链接它,但是当使用某些类型的库时,我会收到如下所示的错误。
具体来说,我对使用示例 Surface_reconstruction_points_3
很感兴趣,我最初尝试构建它,但收到此错误:
Linking CXX executable poisson_reconstruction
Undefined symbols for architecture x86_64:
"CGAL::File_writer_OFF::write_header(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, unsigned long, unsigned long, unsigned long, bool)", referenced from:
void CGAL::generic_print_polyhedron<CGAL::Polyhedron_3<CGAL::Epick, CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::__1::allocator<int> >, CGAL::File_writer_OFF>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, CGAL::Polyhedron_3<CGAL::Epick, CGAL::Polyhedron_items_3, CGAL::HalfedgeDS_default, std::__1::allocator<int> > const&, CGAL::File_writer_OFF&) in poisson_reconstruction.cpp.o
"CGAL::is_binary(std::__1::basic_ios<char, std::__1::char_traits<char> >&)", referenced from:
_main in poisson_reconstruction.cpp.o
"CGAL::is_pretty(std::__1::basic_ios<char, std::__1::char_traits<char> >&)", referenced from:
_main in poisson_reconstruction.cpp.o
"CGAL::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&, CGAL::File_header_OFF&)", referenced from:
CGAL::Polyhedron_scan_OFF<CGAL::HalfedgeDS_default<CGAL::Epick, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::__1::allocator<int> > >::operator()(CGAL::HalfedgeDS_default<CGAL::Epick, CGAL::I_Polyhedron_derived_items_3<CGAL::Polyhedron_items_3>, std::__1::allocator<int> >&) in poisson_reconstruction.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [poisson_reconstruction] Error 1
make[1]: *** [CMakeFiles/poisson_reconstruction.dir/all] Error 2
make: *** [all] Error 2
具体来说,我实际上对函数 CGAL::make_normal_of_point_with_normal_pmap
很感兴趣,并构建了一个测试用例,只是为了尝试使用它。但是,我在编译此代码(如下)时收到错误消息。
#include <stdio.h>
#include <vector>
#include <CGAL/trace.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Surface_mesh_default_criteria_3.h>
#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Implicit_surface_3.h>
#include <CGAL/IO/output_surface_facets_to_polyhedron.h>
#include <CGAL/Poisson_reconstruction_function.h>
#include <CGAL/Point_with_normal_3.h>
#include <CGAL/property_map.h>
#include <CGAL/compute_average_spacing.h>
#include <CGAL/Gray_level_image_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/IO/read_xyz_points.h>
#include <CGAL/IO/Complex_2_in_triangulation_3_file_writer.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef Kernel::Sphere_3 Sphere;
typedef CGAL::Point_with_normal_3<Kernel> Point_with_normal;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Poisson_reconstruction_function<Kernel> Poisson_reconstruction_function;
typedef CGAL::Surface_mesh_default_triangulation_3 STr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
typedef CGAL::Implicit_surface_3<Kernel, Poisson_reconstruction_function> Surface_3;
typedef STr::Geom_traits STrGT;
typedef FT (*Function)(Point);
typedef CGAL::Implicit_surface_3<STrGT, Function> ImplSurface;
typedef CGAL::Gray_level_image_3<FT, Point> Gray_level_image;
typedef CGAL::Implicit_surface_3<STrGT, Gray_level_image> Gray_level_surface;
FT sphere_function (Point p) {
const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z();
return x2+y2+z2-100;
}
int main(void)
{
printf("Hello, world!\n");
std::vector<Point_with_normal> points;
for (double d=0.0; d<10.0; d+=1.0)
{
Point_with_normal p( 0.0, 1.0*(d), 1.0*(d*d), Vector(0.0, 1.0, 0.0) );
points.push_back(p);
}
Poisson_reconstruction_function function(points.begin(), points.end(),
CGAL::make_normal_of_point_with_normal_pmap(points.begin()) );
return 0;
}
以及相应的错误信息:
[100%] Building CXX object CMakeFiles/cgal_test.dir/cgal_test.cpp.o
/usr/bin/c++ -DCGAL_USE_GMP -DCGAL_USE_MPFR -DWITH_CGAL -O3 -DNDEBUG -isystem /usr/local/include -I/Users/chris/dev/intern/test/cgal_testing/build -I/usr/local/Cellar/cgal/4.3/include -o CMakeFiles/cgal_test.dir/cgal_test.cpp.o -c /Users/chris/dev/intern/test/cgal_testing/cgal_test.cpp
In file included from /Users/chris/dev/intern/test/cgal_testing/cgal_test.cpp:5:
In file included from /usr/local/Cellar/cgal/4.3/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:28:
In file included from /usr/local/Cellar/cgal/4.3/include/CGAL/Simple_cartesian.h:28:
In file included from /usr/local/Cellar/cgal/4.3/include/CGAL/Cartesian/Cartesian_base.h:28:
In file included from /usr/local/Cellar/cgal/4.3/include/CGAL/basic.h:46:
In file included from /usr/local/Cellar/cgal/4.3/include/CGAL/kernel_basic.h:34:
/usr/local/Cellar/cgal/4.3/include/CGAL/Kernel_traits.h:33:23: error: no type named 'R' in
'std::__1::__wrap_iter<CGAL::Point_with_normal_3<CGAL::Epick> *>'
typedef typename T::R Kernel;
~~~~~~~~~~~~^
/usr/local/Cellar/cgal/4.3/include/CGAL/Point_with_normal_3.h:169:18: note: in instantiation of template class
'CGAL::Kernel_traits<std::__1::__wrap_iter<CGAL::Point_with_normal_3<CGAL::Epick> *> >' requested here
typename CGAL::Kernel_traits<Point_with_normal>::Kernel>
^
/usr/local/Cellar/cgal/4.3/include/CGAL/Point_with_normal_3.h:170:3: note: while substituting deduced template arguments into function template
'make_normal_of_point_with_normal_pmap' [with Point_with_normal = std::__1::__wrap_iter<CGAL::Point_with_normal_3<CGAL::Epick> *>]
make_normal_of_point_with_normal_pmap(Point_with_normal)
^
/Users/chris/dev/intern/test/cgal_testing/cgal_test.cpp:60:13: error: no matching function for call to 'make_normal_of_point_with_normal_pmap'
CGAL::make_normal_of_point_with_normal_pmap(points.begin()) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/cgal/4.3/include/CGAL/Point_with_normal_3.h:170:3: note: candidate template ignored: substitution failure [with Point_with_normal =
std::__1::__wrap_iter<CGAL::Point_with_normal_3<CGAL::Epick> *>]
make_normal_of_point_with_normal_pmap(Point_with_normal)
^
2 errors generated.
make[2]: *** [CMakeFiles/cgal_test.dir/cgal_test.cpp.o] Error 1
make[1]: *** [CMakeFiles/cgal_test.dir/all] Error 2
make: *** [all] Error 2
正如预期的那样,构建所有示例的标准方法也会触发错误(此处我尝试构建所有 CGAL 示例)。为此,我使用 cmake
从源代码构建了 CGAL 4.3
库,并在设置中启用了 WITH_examples
。编译时我调用了 make
和 make examples
,这导致了这个错误:
[ 15%] Building CXX object examples/Segment_Delaunay_graph_2/CMakeFiles/sdg-info-set.dir/sdg-info-set.cpp.o
Linking CXX executable Compute_Ridges_Umbilics
Undefined symbols for architecture x86_64:
"boost::program_options::to_internal(std::string const&)", referenced from:
std::vector<std::string, std::allocator<std::string> > boost::program_options::to_internal<std::string>(std::vector<std::string, std::allocator<std::string> > const&) in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)", referenced from:
_main in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::invalid_option_value::invalid_option_value(std::string const&)", referenced from:
void boost::program_options::validate<double, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, double*, long) in Compute_Ridges_Umbilics.cpp.o
void boost::program_options::validate<unsigned int, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned int*, long) in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)", referenced from:
std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::string, std::string>, std::string const&>)", referenced from:
boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::string, std::string>, std::string const&>) in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::detail::cmdline::cmdline(std::vector<std::string, std::allocator<std::string> > const&)", referenced from:
boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::validate(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, std::string*, int)", referenced from:
boost::program_options::typed_value<std::string, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::validate(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool*, int)", referenced from:
boost::program_options::typed_value<bool, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::operator<<(std::ostream&, boost::program_options::options_description const&)", referenced from:
_main in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const", referenced from:
vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::invalid_option_value> > in Compute_Ridges_Umbilics.cpp.o
vtable for boost::exception_detail::error_info_injector<boost::program_options::invalid_option_value> in Compute_Ridges_Umbilics.cpp.o
vtable for boost::program_options::invalid_option_value in Compute_Ridges_Umbilics.cpp.o
vtable for boost::program_options::validation_error in Compute_Ridges_Umbilics.cpp.o
vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::validation_error> > in Compute_Ridges_Umbilics.cpp.o
vtable for boost::exception_detail::error_info_injector<boost::program_options::validation_error> in Compute_Ridges_Umbilics.cpp.o
"boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const", referenced from:
vtable for boost::program_options::typed_value<bool, char> in Compute_Ridges_Umbilics.cpp.o
vtable for boost::program_options::typed_value<double, char> in Compute_Ridges_Umbilics.cpp.o
vtable for boost::program_options::typed_value<unsigned int, char> in Compute_Ridges_Umbilics.cpp.o
vtable for boost::program_options::typed_value<std::string, char> in Compute_Ridges_Umbilics.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [examples/Ridges_3/Compute_Ridges_Umbilics] Error 1
make[2]: *** [examples/Ridges_3/CMakeFiles/Compute_Ridges_Umbilics.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
最后,如果您知道如何让 make_normal_of_point_with_normal_pmap
函数再次运行,那就太棒了。我真的不需要构建所有示例,但想再次使用 CGAL
的那部分。谢谢!
最佳答案
我对 CGAL
不是很熟悉,但我敢猜测您已经使用 libc++
编译了一些代码,还有一些使用 libstdc++
编译的代码。
关于c++ - CGAL:如何成功编译和链接 CGAL 示例(在 Mac OS X 10.9 Mavericks 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19689245/
#include using namespace std; class C{ private: int value; public: C(){ value = 0;
这个问题已经有答案了: What is the difference between char a[] = ?string?; and char *p = ?string?;? (8 个回答) 已关闭
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 7 年前。 此帖子已于 8 个月
除了调试之外,是否有任何针对 c、c++ 或 c# 的测试工具,其工作原理类似于将独立函数复制粘贴到某个文本框,然后在其他文本框中输入参数? 最佳答案 也许您会考虑单元测试。我推荐你谷歌测试和谷歌模拟
我想在第二台显示器中移动一个窗口 (HWND)。问题是我尝试了很多方法,例如将分辨率加倍或输入负值,但它永远无法将窗口放在我的第二台显示器上。 关于如何在 C/C++/c# 中执行此操作的任何线索 最
我正在寻找 C/C++/C## 中不同类型 DES 的现有实现。我的运行平台是Windows XP/Vista/7。 我正在尝试编写一个 C# 程序,它将使用 DES 算法进行加密和解密。我需要一些实
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
有没有办法强制将另一个 窗口置于顶部? 不是应用程序的窗口,而是另一个已经在系统上运行的窗口。 (Windows, C/C++/C#) 最佳答案 SetWindowPos(that_window_ha
假设您可以在 C/C++ 或 Csharp 之间做出选择,并且您打算在 Windows 和 Linux 服务器上运行同一服务器的多个实例,那么构建套接字服务器应用程序的最明智选择是什么? 最佳答案 如
你们能告诉我它们之间的区别吗? 顺便问一下,有什么叫C++库或C库的吗? 最佳答案 C++ 标准库 和 C 标准库 是 C++ 和 C 标准定义的库,提供给 C++ 和 C 程序使用。那是那些词的共同
下面的测试代码,我将输出信息放在注释中。我使用的是 gcc 4.8.5 和 Centos 7.2。 #include #include class C { public:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我的客户将使用名为 annoucement 的结构/类与客户通信。我想我会用 C++ 编写服务器。会有很多不同的类继承annoucement。我的问题是通过网络将这些类发送给客户端 我想也许我应该使用
我在 C# 中有以下函数: public Matrix ConcatDescriptors(IList> descriptors) { int cols = descriptors[0].Co
我有一个项目要编写一个函数来对某些数据执行某些操作。我可以用 C/C++ 编写代码,但我不想与雇主共享该函数的代码。相反,我只想让他有权在他自己的代码中调用该函数。是否可以?我想到了这两种方法 - 在
我使用的是编写糟糕的第 3 方 (C/C++) Api。我从托管代码(C++/CLI)中使用它。有时会出现“访问冲突错误”。这使整个应用程序崩溃。我知道我无法处理这些错误[如果指针访问非法内存位置等,
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一些 C 代码,将使用 P/Invoke 从 C# 调用。我正在尝试为这个 C 函数定义一个 C# 等效项。 SomeData* DoSomething(); struct SomeData {
这个问题已经有答案了: Why are these constructs using pre and post-increment undefined behavior? (14 个回答) 已关闭 6
我是一名优秀的程序员,十分优秀!