Eclipse CDT 无法与集成了 Cygwin 编译器的 OpenCV 2.0 一起使用

发布于 2024-12-27 10:48:46 字数 277 浏览 1 评论 0原文

我已经完成了所有必要的工作,例如将“c:/cygwin/bin”添加到系统路径,我还在项目->属性->c/c++ build->下设置了 include 路径;设置并设置链接库搜索路径。
现在,当我包含像#include“cv.h”这样的文件时,它不会给出错误,但是当我运行程序时,错误会出现,例如

对“_cvGetSize”的未定义引用

我已经包含了必要的文件,并阅读了很多可用的教程,但我仍然无法运行我的代码,请帮助我

I have done all the necessary job like adding "c:/cygwin/bin" to system path, I have also set the include path under project->properties->c/c++ build->setting and also set the linker library search path.
Now when I include file like #include"cv.h", it gives no error, but when I run the program error comes like

undefined reference to '_cvGetSize'

I have included the necessary files, and read lots of tutorials that are available but still I couldn't able to run my code, please help me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光无声 2025-01-03 10:48:46

我总是建议在跳转到 IDE 之前,通过尝试在 cmd 行上编译应用程序来确保您的系统已正确安装和配置:

g++ flann.cpp -o flann `pkg-config --cflags --libs opencv`

或者:

g++ flann.cpp -o flann -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

显然您没有将您的项目与 opencv 库链接,这是正在实现的在上面的 cmd 中使用: -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objDetect -lopencv_contrib -lopencv_legacy -lopencv_flann

该缺失的符号是在这些库之一中定义的。

I always recommend that before jumping to an IDE you make sure your system is installed and configured correctly by attempting to compile an application on the cmd-line:

g++ flann.cpp -o flann `pkg-config --cflags --libs opencv`

or:

g++ flann.cpp -o flann -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

Apparently you didn't link your project with the opencv libraries, which is being achieved in the cmd above with: -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann.

That missing symbol is defined in one of these libraries.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文