无法使用opencv库运行C ++程序(Can't run a C++ program with opencv library)
我为opencv编写了一个简单的测试程序,看看它是否在我在Visual Studio 2010专业版中编译我的OpenCV 2.4之后才能正常工作。
该计划如下:
#include "StdAfx.h" #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main() { Mat im = imread("c:/full/path/to/lena.jpg"); if (im.empty()) { cout << "Cannot load image!" << endl; return -1; } imshow("Image", im); waitKey(0); }
问题是程序编译没有问题(我已经设置了所有的lib路径并在visual studio中包含路径),但是当我尝试运行它时,它给了我以下错误信息winow:“程序无法启动因为您的计算机缺少opencv_core240d.dll。请尝试重新安装该程序以解决此问题“
现在,我已经读过这可以通过执行cmd命令将windows PATH变量设置为实际.dll文件所在的目录来解决:
SET PATH="C:\Program Files (x86)\OpenCV\opencv\build\bin\Debug"
指定的路径确实是.dll文件所在的路径,但是,我仍然得到错误。
真的很感激,因为我花了太多时间在这周围徘徊......
I wrote a simple test program for opencv to see if it's working after I compiled my OpenCV 2.4 in visual studio 2010 pro.
The program goes like this:
#include "StdAfx.h" #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main() { Mat im = imread("c:/full/path/to/lena.jpg"); if (im.empty()) { cout << "Cannot load image!" << endl; return -1; } imshow("Image", im); waitKey(0); }
The thing is that the program compiles without problems ( I've set all the lib paths and include paths in visual studio), but when I try to run it, it gives me the following error message winow: "The program can't start because opencv_core240d.dll is missing from your computer. Try reinstalling the program to fix this problem"
Now, I've read that this could be solved by setting the windows PATH variable to the directory where the actual .dll file is located by doing a cmd command:
SET PATH="C:\Program Files (x86)\OpenCV\opencv\build\bin\Debug"
The path specified is indeed the path where the .dll file is located however, I still get the error.
Help would really be appreciated since I've spent far too much time cocking around this...
原文:https://stackoverflow.com/questions/11056226
最满意答案
您需要一个
<form>
元素才能触发onsubmit
事件。 将<input>
元素包装在表单中,它将起作用。<form> <!-- Start Search --> <div class="top-search"> <div class="container"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-search"></i></span> <input id="search" type="text" class="form-control" placeholder="Search"> <span class="input-group-addon close-search"><i class="fa fa-times"></i></span> </div> </div> </div> <!-- End Search --> </form>
You need a
<form>
element in order for theonsubmit
event to be triggered. Wrap the<input>
element in a form and it will work.<form> <!-- Start Search --> <div class="top-search"> <div class="container"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-search"></i></span> <input id="search" type="text" class="form-control" placeholder="Search"> <span class="input-group-addon close-search"><i class="fa fa-times"></i></span> </div> </div> </div> <!-- End Search --> </form>
相关问答
更多-
HTML到Google协作平台(HTML to Google Sites)[2023-08-07]
我认为此常见问题解答有助于了解Google协作平台究竟是什么,它能做什么,不能做什么。 不幸的是,谷歌网站并不像我们想要的那样灵活和强大。 根据您的需要,您可以尝试使用Blogger或Google App Enginge 。 您可以搜索简单的CMS for GAE并尝试将Dreamweaver项目导出到GAE托管。 如果它会对你有所帮助,请通知我。 我觉得这很有趣。 I think this FAQ can be helpful to understand what Google Sites exactly ... -
import requests import json from bs4 import BeautifulSoup headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36'} s = requests.get('http://www.google.com/search?q= ...
-
如何使用HTML标签更改我的网站的Google搜索结果标题?(How to change google search results title for my site using HTML tags?)[2023-01-15]
example 1 - short statement 用它来显示主标题。 它应该放在你的索引上,这样你的主页就会像这样结束。 您可以通过查看网络浏览器中的标签来验证其是否有效,是否反映了您希望在Google搜索结果中显示的内容。 本指南: https : //moz.com/learn/seo/title-tag将帮助您了解更多信息并使用它。example 1 - short statement Use this to display ... -
HTML5(这是他们声明的那个页面)允许你省略很多东西。 例如, body标签的开始和结束标签都是可选的,就像结束html标签( ref )一样。 验证器说它是有效的 ,但验证器的HTML5支持也是实验性的。 因人而异 HTML5 (which is what they're declaring that page as) allows you to omit a lot of stuff. For instance, the body tag's start and end tags are both o ...
-
使用Google搜索HTML(Searching HTML using Google)[2024-01-25]
您需要一个