我使用包含
的visual studio 2015开发了一些功能#include <msclr\marshal_cppstd.h>;
当我尝试在2013年的visual studio上打开时,
error C2059: syntax error : ')'
error C2059: syntax error : ')'
error C2059: syntax error : ')'
error C2059: syntax error : ')'
error C2143: syntax error : missing ';' before '__stdcall'
error C2143: syntax error : missing ';' before '__stdcall'
error C2146: syntax error : missing ')' before identifier 'hDesktop'
error C2146: syntax error : missing ')' before identifier 'hDesktop'
error C2146: syntax error : missing ')' before identifier 'hDesktop'
error C2146: syntax error : missing ')' before identifier 'hDesktop'
error C2146: syntax error : missing ';' before identifier 'hdesk'
error C2377: 'HDESK' : redefinition; typedef cannot be overloaded with any other symbol
error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'
error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'
error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'
error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'
它会发生什么? 有人可以告诉我为什么吗?
这个代码
#include "Stdafx.h"
#include "Image.h"
#include <msclr\marshal_cppstd.h>
Image::Image(System::String^ path)
{
std::string str = msclr::interop::marshal_as<std::string>(path);
_mat = new cv::Mat();
(*_mat) = cv::imread(str);
}
在Visual Studio 2015中运行良好的代码,但是在vs2013中。它无法正常工作