在Windows(W32)上安装opencv以与代码块一起使用

发布于 2024-09-26 14:21:27 字数 304 浏览 4 评论 0原文

我正在尝试使用带有代码块(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 技术交流群。

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

发布评论

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

评论(1

×眷恋的温暖 2024-10-03 14:21:27

几周前我遇到了同样的问题,但在任何地方都找不到答案!
经过一番折腾后,我确切地知道了该怎么做。

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.

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