在Windows(W32)上安装opencv以与代码块一起使用
我正在尝试使用带有代码块(8.02)的opencv库。我已经安装了opencv2.1。 当我包含标题并链接库时,一切都很好。我已经浏览了 http://opencv.willowgarage。 com/wiki/CodeBlocks 教程也是如此。但是当我编译项目时 它没有报告任何错误或警告。它只是说以状态 1 退出。
我想知道是否有人使用带有代码块的 opencv 并可以帮助我摆脱这种情况。
谢谢!!!
i am trying to use opencv library with code blocks(8.02).i have installed opencv2.1.
when i include the headers and link the library its all fine.i have gone through http://opencv.willowgarage.com/wiki/CodeBlocks tutorial as well.but when i compile the project
it reports no error or warning.it just says exit with status 1.
i want to know if anyone who has used opencv with code blocks and can please help me out of this situation.
thanks!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几周前我遇到了同样的问题,但在任何地方都找不到答案!
经过一番折腾后,我确切地知道了该怎么做。
1)使用Cmake编译库。 http://www.cmake.org/
2) 编译库后,您应该有两个不同的 OpenCV 库- 一种是编译型的,另一种是非编译型的。
3)在“代码块”中,单击“设置”(在“文件”菜单中)。在“设置”下,选择“编译器”和“调试器”。
4)选择搜索目录选项卡。选择搜索目录下的编译器选项卡。单击添加。浏览到该库的未编译版本。在非编译目录中,选择include文件夹。在包含文件夹下,选择 OpenCV。单击“确定”
5)在代码块中,选择“搜索目录”选项卡下的“链接器”选项卡。单击“添加”,这次浏览到库的已编译版本。在编译的目录中,选择lib文件夹,然后单击确定。
6) 转到代码块中的链接器设置选项卡。单击添加。浏览到库的已编译版本。在编译的目录中选择lib。在 lib 文件夹中选择所有库。确保仅选择动态库文件(.dylib 扩展名)
7) Codeblocks 已设置!
8) 运行你的项目,它应该可以正常工作。
如果您仍然遇到问题,请随时寻求更多帮助。
I had this exact same problem a couple of weeks ago and couldn't find an answer anywhere !
After messing around with it, I found out exactly how to do it.
1) Compile the library using Cmake. http://www.cmake.org/
2) After your library is compiled you should have two different OpenCV libraries - a compiled one, and a non-compiled one.
3)In Code Blocks, click on Settings (In the File Menu). Under Settings, select Compiler and Debugger.
4)Select the Search Directories tab.Select the compiler tab under search directories. Click Add. Browse to your NON-COMPILED version of the library. In the non-compiled directory, select the include folder. Under the include folder, select OpenCV. Click OK
5)In codeblocks, select the linker tab, which is under the Search Directories tab.. Click on add and this time browse to your COMPILED version of the library. In the compiled directory, select the lib folder and click OK.
6) Go to the linker settings tab in codeblocks. Click Add. Browse to the COMPILED version of the library. In the compiled directory select lib. In the lib folder select all the libraries. Make sure to only select only the dynamic library files (.dylib extention)
7) Codeblocks is setup!
8) Run your project and it should work fine.
Feel free to ask for more help if you are still having problems.