运行Opencv代码对象跟踪

时间:2015-02-26 08:29:57

标签: c++ visual-studio-2010 opencv opencv3.0

我在我的系统中安装了visual studio c ++ 2010& 2013。我试图在链接中运行示例代码show Link to install opencv 2.4.3我的配置完全如上所述。 我打开CVbeta3.0.0&版本2.4.10。

#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);
}

如上所述,我从

更改了链接器
opencv_calib3d243d.lib
opencv_contrib243d.lib
opencv_core243d.lib
opencv_features2d243d.lib
opencv_flann243d.lib
opencv_gpu243d.lib
opencv_haartraining_engined.lib
opencv_highgui243d.lib
opencv_imgproc243d.lib
opencv_legacy243d.lib
opencv_ml243d.lib
opencv_nonfree243d.lib
opencv_objdetect243d.lib
opencv_photo243d.lib
opencv_stitching243d.lib
opencv_ts243d.lib
opencv_video243d.lib
opencv_videostab243d.lib

opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_haartraining_engined.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib

当我完全编译代码时,我得到以下错误

  

1&gt; ------构建开始:项目:跟踪,配置:调试Win32 ------   1 GT; moving.cpp   1&gt; c:\ program files(x86)\ microsoft visual studio 12.0 \ vc \ include \ cwchar(29):错误C2039:&#39; swprintf&#39; :不是&{39; global namespace'' 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(29): error C2873: 'swprintf' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(30): error C2039: 'vswprintf' : is not a member of '全局命名空间的成员&#39;&#39;   1&gt; c:\ program files(x86)\ microsoft visual studio 12.0 \ vc \ include \ cwchar(30):错误C2873:&#39; vswprintf&#39; :symbol不能在using声明中使用   ==========构建:0成功,1个失败,0个最新,0个跳过==========

请让我知道如何解决这个问题。

// cwchar standard header
#pragma once
#ifndef _CWCHAR_
#define _CWCHAR_
#include <yvals.h>

#ifdef _STD_USING
 #undef _STD_USING
  #include <wchar.h>
 #define _STD_USING

#else /* _STD_USING */
 #include <wchar.h>
#endif /* _STD_USING */

typedef mbstate_t _Mbstatet;

 #if _GLOBAL_USING && !defined(RC_INVOKED)
_STD_BEGIN
using _CSTD _Mbstatet;

using _CSTD mbstate_t; using _CSTD size_t; using _CSTD tm; using _CSTD wint_t;

using _CSTD btowc; using _CSTD fgetwc; using _CSTD fgetws; using _CSTD fputwc;
using _CSTD fputws; using _CSTD fwide; using _CSTD fwprintf;
using _CSTD fwscanf; using _CSTD getwc; using _CSTD getwchar;
using _CSTD mbrlen; using _CSTD mbrtowc; using _CSTD mbsrtowcs;
using _CSTD mbsinit; using _CSTD putwc; using _CSTD putwchar;
using _CSTD swprintf; using _CSTD swscanf; using _CSTD ungetwc;
using _CSTD vfwprintf; using _CSTD vswprintf; using _CSTD vwprintf;
using _CSTD wcrtomb; using _CSTD wprintf; using _CSTD wscanf;
using _CSTD wcsrtombs; using _CSTD wcstol; using _CSTD wcscat;
using _CSTD wcschr; using _CSTD wcscmp; using _CSTD wcscoll;
using _CSTD wcscpy; using _CSTD wcscspn; using _CSTD wcslen;
using _CSTD wcsncat; using _CSTD wcsncmp; using _CSTD wcsncpy;
using _CSTD wcspbrk; using _CSTD wcsrchr; using _CSTD wcsspn;
using _CSTD wcstod; using _CSTD wcstoul; using _CSTD wcsstr;
using _CSTD wcstok; using _CSTD wcsxfrm; using _CSTD wctob;
using _CSTD wmemchr; using _CSTD wmemcmp; using _CSTD wmemcpy;
using _CSTD wmemmove; using _CSTD wmemset; using _CSTD wcsftime;

using _CSTD vfwscanf; using _CSTD vswscanf; using _CSTD vwscanf;
using _CSTD wcstof; using _CSTD wcstold;
using _CSTD wcstoll; using _CSTD wcstoull;
_STD_END
 #endif /* _GLOBAL_USING */

#endif /* _CWCHAR_ */

/*
 * Copyright (c) 1992-2013 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V6.40:0009 */

当我点击错误行<= em>时<

0 个答案:

没有答案