【发布时间】:2012-09-16 11:03:05
【问题描述】:
我一直在尝试为我的 windows 7 64 位安装 opencv。 我的基本目标是在 C 语言中使用 opencv。我有 borland 和 mingw 编译器。 我完全按照描述使用了Getting started with OpenCV 2.4 and MinGW on Windows 7 指南。但我不断收到以下回复:
C:\Users\Rachit Dell\Pictures>g++ -I"C:\opencv\build\include" -L"C:\opencv\build
\x86\mingw\lib" loadimg.cpp -lopencv_core240 -lopencv_highgui240 -o loadimg
loadimg.cpp:1:39: error: opencv2/highgui/highgui.hpp: No such file or directory
loadimg.cpp:4: error: 'cv' is not a namespace-name
loadimg.cpp:4: error: expected namespace-name before ';' token
loadimg.cpp: In function 'int main(int, char**)':
loadimg.cpp:9: error: 'Mat' was not declared in this scope
loadimg.cpp:9: error: expected ';' before 'im'
loadimg.cpp:10: error: 'im' was not declared in this scope
loadimg.cpp:16: error: 'im' was not declared in this scope
loadimg.cpp:16: error: 'imshow' was not declared in this scope
loadimg.cpp:17: error: 'waitKey' was not declared in this scope
我使用的是 2.4.2 版本。
有人可以指导我吗?我只需要设置一个 IDE 就可以在 C 中编译 opencv。
谢谢
【问题讨论】:
-
尝试从
-I(和-L)值中删除双引号。 -
那些双引号是用来封闭给定路径的。无论如何,我确实尝试了你的建议。没用
-
显然 highgui.hpp 丢失或未按预期检测到,我会尝试解决此问题。检查它是否正确包含。新用户提示 - 如果您认为某个答案很好,请记住稍后返回并标记答案已接受。
-
我已经检查了 highgui.hpp 文件。它非常有。我也检查了提供的路径。所以我真的只是卡住了。