从MinGW链接到OpenCV的问题 [英] Problems linking to OpenCV from MinGW

查看:482
本文介绍了从MinGW链接到OpenCV的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始一个小项目,使用OpenCV。我的目标是一个Windows 7机器,所以我试图用MinGW生成本机​​Windows二进制文件。在我的Fedora 19安装中,简单的源代码编译和工作正常与 gcc

I would like to start a small project, that uses OpenCV. My target is a Windows 7 machine, so I am trying to generate native Windows binaries with MinGW. The simple source compiles and works fine with gcc on my Fedora 19 installation. However, under Windows here are my problems.

我尝试从命令行调用g ++,尝试了一个简单的makefile,最后绑定了教程。问题是一个蚂蚁是一样的。

I tried invoking g++ from the command line, tried a simple makefile and lastly, tied this tutorial. The problem is one ant the same.

>

我相信这些都是Visual Studio builds。教程中的家伙用一个 mingw 文件夹代替vc12文件夹。在这些文件夹中有类似于 opencv_imgproc249d.lib 的库,但是当我链接它们时,没有符号得到解决,一切都是未定义的引用。

I believe those are Visual Studio builds. The guy from the tutorial has a mingw folder in place of vc12 folders. Inside these folders there are libraries of the sort of opencv_imgproc249d.lib, but when I link against them, no symbols get resolved, everything is "undefined reference".

我想因为各种原因不使用Visul Studio。然而,我绝对不想自己构建库,知道什么依赖关系潜伏在底下。

I would like not to use Visul Studio for a variety of reasons. However, I would absolutely not want to build the library myself, knowing what dependency hell lurks underneath.

任何提示如何解决这个问题?我的目标目标是能够链接到一个随便下载的opencv版本与gnu makefile。

Any tips how to fix this issue? My target goal is be able to link against a readily downloaded opencv build with a gnu makefile.

推荐答案


  • 我的目标目标是能够链接到一个随时下载的opencv版本与一个gnu makefile

    • "My target goal is be able to link against a readily downloaded opencv build with a gnu makefile"

      可悲的是,没有更多的prebuild mingw库, ,你不能使用vs的libs与mingw,
      所以第一步将调用cmake和构建opencv libs从src。

      sadly there are no more prebuild mingw libs, and no, you can't use the vs libs with mingw, so the 1st step would be to invoke cmake and build the opencv libs from src.

      我绝对不想自己构建库

      啊不要害怕,只要快速尝试。

      ah don't be too afraid of it, just give it a quick try.

      与linux不同,windows上没有进一步的依赖关系。
      (当然,你需要java和ant构建java包装器,python - 如果你想要的话等等)

      unlike on linux, there are no further dependancies on windows for common opencv. (sure, you need java and ant to build the java wrappers, python - if you wanted that, etc..)

      这篇关于从MinGW链接到OpenCV的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆