0

我正在使用安装在我的系统中的 Visual Studio C++ 2010&2013。我正在尝试运行链接 链接中显示的示例代码来安装我配置的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>----- 构建开始:项目:跟踪,配置:调试 Win32 ------ 1>moving.cpp 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\ cwchar(29):错误 C2039:“swprintf”:不是“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 '全局命名空间”的成员 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(30):错误 C2873: 'vswprintf' : 符号不能在使用声明中使用 ========== 构建: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 */

当我点击错误行时,这部分内容

4

0 回答 0