Comments (2)
It seems a VS2010 issue. Is your visual studio up-to-date (patches, service pack, etc.)?
from mexopencv.
The same issue was reported before (#16), but the ticket somehow disappeared.. (maybe original user deleted their account?)
Anyway, I recovered the discussion using Google cache, which I quote below for the record.
Please try the suggested solutions and report if the problem is fixed
Problem with visual studio 2010
newbie19 opened this issue September 08, 2012
I tried mexopencv using Matlab 2010a, opencv 2.4.2, and visual studio 2010, then I got following problem:
MxArray.cpp C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : error C2371: 'char16_t' : redefinition; different basic types c:\program files\matlab\r2010a\extern\include\matrix.h(330) : see declaration of 'char16_t'
By googling I learned that this problem occurs since I used visual studio 2010. There are many suggested solutions here:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/281754
but I don't know how to implement it for mexopencv.The first error happened in MxArray.cpp , but I cannot find any line that called matrix.h.
So, can somebody help me here?
amroamroamro commented September 08, 2012
What do you get when you try to compile a minimalistic MEX function?
#include "mex.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { mexPrintf("test\n"); }
Save the above in a C++ file textMEX.cpp, and compile it using mex testMEX.cpp
In case of problems, the following section found towards the end of tmwtypes.h could be the cause of your issues:
$MATLABROOT\extern\include\tmwtypes.h
/** UTF-16 character type */ #if defined(__STDC_UTF_16__) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT) typedef char16_t CHAR16_T; #elif defined(_MSC_VER) typedef wchar_t CHAR16_T; #else typedef UINT16_T CHAR16_T; #endif
This file is included by "matrix.h" which is in turn included by "mex.h" (required by all MEX files)
(I am using R2012a on WinXP+VS2010 and I have no problems compiling)
kyamagu commented September 08, 2012
Do you install Windows SDK? You say you're using vs2010 win64 but at least your compiler seems to be x86. Make sure you're using 64-bit compiler in Matlab 64-bit and also run mex -setup to choose Win SDK for the compiler.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : error C2371: 'char16_t' : redefinition; different basic types c:\program files\matlab\r2010a\extern\include\matrix.h(330) : see declaration of 'char16_t'
amroamroamro commented September 08, 2012
Also VS2010 was only officially supported starting at MATLAB R2010b, although there is a patch available for R2010a. Perhaps you should consider updating MATLAB if possible..
As a quick fix, try editing MxArray.hpp, and move mex.h after the other includes with:
#ifdef _CHAR16T #define CHAR16_T #endif #include "mex.h"
Some more references found here and here.
kyamagu closed the issue November 07, 2012
from mexopencv.
Related Issues (20)
- Mexopencv using MatLab Runtime
- Using homebrew to install OpenCV==3.4.1
- windows opencv3.4.1 cmake
- Setting up mexopencv for matlab 2018b HOT 2
- No output from cv.getBuildInformation() in Octave 5.1.0
- maybe bug about the queryIdx and trainIdx
- ld: symbol(s) not found for architecture x86_64
- Invalid MEX-file : Missing dependent shared libraries
- [error 3] gcc >= 4.4 g++ >= 4.4 is installed
- v3.2.0 and xfeatures2d HOT 1
- mexopencv not compiling HOT 2
- error in setup opencv and mexopencv
- how Mac to mexopencv HOT 1
- [lib/mexopencv_features2d.o] Error 255 HOT 1
- MxArray::toMoments out of order arguments to cv::Moments
- Consider leveraging MATLAB in your CI
- MATLAB Error: Unrecognized function or variable 'FeaturesFinder_'.
- why can't I use the 'cv.detectMarkers' function???
- Hi all, I have a big problem when I am using matlab R2021a to builed mexopencv. HOT 1
- mexopencv building error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mexopencv.