0

I am using visual studio c++ 2010&2013 installed in my system. I am trying to run the example code show in link Link to install opencv 2.4.3I configured as exactly like mentioned above. I am having open CVbeta3.0.0 & version 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);
}

As mentioned i changed linker from

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

To

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

When i compile code fully i get below error

1>------ Build started: Project: Track, Configuration: Debug Win32 ------ 1> moving.cpp 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(29): error C2039: 'swprintf' : is not a member of '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 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(30): error C2873: 'vswprintf' : symbol cannot be used in a using-declaration ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

please let me know how can i resolve the issue.

// 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 */

This part where it goes to when i click error line

Community
  • 1
  • 1
user50949
  • 37
  • 2
  • 7
  • Looks like the linking is not right. Take a look at this: https://drthitirat.wordpress.com/2014/12/26/install-opencv-2-4-10-and-use-it-in-msvc-2013-and-qt-5-4-0-of-windows-8-1-64-bit-os-x64-based-processor/ – Ha Dang Feb 26 '15 at 10:11
  • Thanks for the links. But same error it showing – user50949 Feb 26 '15 at 11:25
  • Can you post infos about the configuration of opencv in your VS project? – Ha Dang Feb 26 '15 at 11:32
  • You upgraded OpenCV to 2.4.10 and not to 3.0.0-beta. `opencv_calib3d2410d.lib` -> `2410d` means the lib belongs to 2.4.10 debug version. But how does `moving.cpp` look like? – Kornel Feb 26 '15 at 11:53
  • i am using openCV2.4.10 only.i dont anything here**1>------ Build started: Project: Track, Configuration: Debug Win32 ------ 1> moving.cpp ** I deteled OPENCV3.0 beta deleted . currently having only 2.4.10 – user50949 Feb 26 '15 at 12:06
  • Moving.cpp is my file name.I have attached code as above link. please refer the code above. – user50949 Feb 26 '15 at 12:12

0 Answers0