Thanks for the update. In fact, i managed to make it work with the following approach.
#pragma managed(push, off)
#include <opencv/cv.h>
#pragma managed(pop)
And it works out okay for me.
Hi, I tried to compile a C++/CLI 64-bit .net application with OpenCV 2.1/2.2 and found out that by just doing simple stuff as below will cause internal compiler error. Any workaround is appreciated. I need to eventually build a .net class library using OpenCV using C++/CLI. I have reconfigured OpenCV to be in 64-bit using CMake 2.8. #include "stdafx.h" #include <opencv/cv.h> using namespace System; int main(array<System::String ^> ^args) { Console::WriteLine(L"Hello World"); return 0; } The line "#include <opencv/cv.h>" will cause the compile error Attached is the error log 1>------ Rebuild All started: Project: netcv, Configuration: Debug x64 ------ 1> AssemblyInfo.cpp 1> netcv.cpp 1> stdafx.cpp 1> Generating Code... 1>c:\opencv-2.2.0\bin\include\opencv2\core\mat.hpp(379): fatal error C1001: An internal error has occurred in the compiler. 1> (compiler file 'f:\dd\vctools\compiler\utc\src\p2\wvm\mdmiscw.c', line 2704) 1> To work around this problem, try simplifying or changing the program near the locations listed above. 1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Please wait...
We're also running into this issue compiling some other C++/cli code (not open CV), but trying to trick the compiler with the 64 bit interlocked add (or even removing all interlocked adds just to see if that would compile) results in the same compiler error on the same file.