1

我正在使用 NetBeans 7.0.1 在 Ubuntu 11.10 上使用 OpenCV 2.4.0 开发 C++ 应用程序。当我尝试构建应用程序时,我收到以下链接错误消息。

undefined reference to `cvCreateSubdivDelaunay2D(CvRect, CvMemStorage*)'
undefined reference to `cvSubdivDelaunay2DInsert(CvSubdiv2D*, cv::Point_<int>)'

我已链接到以下库。

libopencv_calib3d_pch_dephelp.a
libopencv_calib3d.so
libopencv_calib3d.so.2.4
libopencv_calib3d.so.2.4.0
libopencv_contrib_pch_dephelp.a
libopencv_contrib.so
libopencv_contrib.so.2.4
libopencv_contrib.so.2.4.0
libopencv_core_pch_dephelp.a
libopencv_core.so
libopencv_core.so.2.4
libopencv_core.so.2.4.0
libopencv_features2d_pch_dephelp.a
libopencv_features2d.so
libopencv_features2d.so.2.4
libopencv_features2d.so.2.4.0
libopencv_flann_pch_dephelp.a
libopencv_flann.so
libopencv_flann.so.2.4
libopencv_flann.so.2.4.0
libopencv_gpu_pch_dephelp.a
libopencv_gpu.so
libopencv_gpu.so.2.4
libopencv_gpu.so.2.4.0
libopencv_haartraining_engine.a
libopencv_highgui_pch_dephelp.a
libopencv_highgui.so
libopencv_highgui.so.2.4
libopencv_highgui.so.2.4.0
libopencv_imgproc_pch_dephelp.a
libopencv_imgproc.so
libopencv_imgproc.so.2.4
libopencv_imgproc.so.2.4.0
libopencv_legacy_pch_dephelp.a
libopencv_legacy.so
libopencv_legacy.so.2.4
libopencv_legacy.so.2.4.0
libopencv_ml_pch_dephelp.a
libopencv_ml.so
libopencv_ml.so.2.4
libopencv_ml.so.2.4.0
libopencv_nonfree_pch_dephelp.a
libopencv_nonfree.so
libopencv_nonfree.so.2.4
libopencv_nonfree.so.2.4.0
libopencv_objdetect_pch_dephelp.a
libopencv_objdetect.so
libopencv_objdetect.so.2.4
libopencv_objdetect.so.2.4.0
libopencv_perf_calib3d_pch_dephelp.a
libopencv_perf_core_pch_dephelp.a
libopencv_perf_features2d_pch_dephelp.a
libopencv_perf_gpu_pch_dephelp.a
libopencv_perf_highgui_pch_dephelp.a
libopencv_perf_imgproc_pch_dephelp.a
libopencv_perf_nonfree_pch_dephelp.a
libopencv_perf_objdetect_pch_dephelp.a
libopencv_perf_photo_pch_dephelp.a
libopencv_perf_stitching_pch_dephelp.a
libopencv_perf_video_pch_dephelp.a
libopencv_photo_pch_dephelp.a
libopencv_photo.so
libopencv_photo.so.2.4
libopencv_photo.so.2.4.0
libopencv_stitching_pch_dephelp.a
libopencv_stitching.so
libopencv_stitching.so.2.4
libopencv_stitching.so.2.4.0
libopencv_test_calib3d_pch_dephelp.a
libopencv_test_contrib_pch_dephelp.a
libopencv_test_core_pch_dephelp.a
libopencv_test_features2d_pch_dephelp.a
libopencv_test_highgui_pch_dephelp.a
libopencv_test_imgproc_pch_dephelp.a
libopencv_test_legacy_pch_dephelp.a
libopencv_test_ml_pch_dephelp.a
libopencv_test_nonfree_pch_dephelp.a
libopencv_test_objdetect_pch_dephelp.a
libopencv_test_photo_pch_dephelp.a
libopencv_test_stitching_pch_dephelp.a
libopencv_test_video_pch_dephelp.a
libopencv_ts_pch_dephelp.a
libopencv_ts.so
libopencv_ts.so.2.4
libopencv_ts.so.2.4.0
libopencv_video_pch_dephelp.a
libopencv_video.so
libopencv_video.so.2.4
libopencv_video.so.2.4.0
libopencv_videostab_pch_dephelp.a
libopencv_videostab.so
libopencv_videostab.so.2.4
libopencv_videostab.so.2.4.0
libraries.txt

如果有人能告诉我如何解决此错误,我将不胜感激。

非常感谢,彼得。

4

1 回答 1

0

在 2.4.0 中,cvSubdivDelaunay2DInsertlibopencv_legacy.so中,因此应该cvCreateSubdivDelaunay2D根据源代码,但在 Mac OS X 上编译的库中找不到最新的。

要验证此信息,请转到 OpenCV 库目录并执行nm. 如果结果在符号名称前出现字母 T,则表示这是实现该符号的库:

$ nm libopencv_legacy.so | grep cvSubdivDelaunay2DInsert    
00000000000b5200 T _cvSubdivDelaunay2DInsert

如果您找不到cvCreateSubdivDelaunay2D使用此技巧,请考虑提交错误。

于 2012-05-14T01:06:43.040 回答