在 QT Creator 中构建 OpenCV 应用程序
我在 Visual studio 10 下使用 CMake 构建了 OpenCV,将二进制文件复制到 opencv 目录中的 /bin 文件夹中。我有一个简单的 OpenCV 程序,没有语法错误,但我收到了几个错误,例如“对 cv::imread 的未定义引用
”。这是为什么呢?
我的 .pro 文件末尾附加了以下内容:
INCLUDEPATH += C:/opencv/build/include/
LIBS += -LC:/opencv/build/x64/vc10/lib \
-lopencv_core231 \
-lopencv_highgui231 \
-lopencv_imgproc231 \
-lopencv_features2d231 \
-lopencv_calib3d231
谢谢
I built OpenCV with CMake under Visual studio 10, copied the binaries to a /bin folder in the opencv directory. I have a simple OpenCV program with no syntax errors, but I am getting several errors such as "undefined reference to cv::imread
". Why is this?
My .pro file has the following appended at the end of it:
INCLUDEPATH += C:/opencv/build/include/
LIBS += -LC:/opencv/build/x64/vc10/lib \
-lopencv_core231 \
-lopencv_highgui231 \
-lopencv_imgproc231 \
-lopencv_features2d231 \
-lopencv_calib3d231
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
未定义的引用
而不是未解析的外部符号
意味着您的应用程序可能使用MinGW,并且您不能将gcc与VC++编译的C++一起使用图书馆。undefined reference
instead ofunresolved external symbol
means you are probably using MinGW for your application, and you can't use gcc with a VC++ compiled C++ library.