2

When I try to compile this code

// Project0.cpp : main project file.

#include "stdafx.h"

using namespace System;
#include <opencv2/core/core.hpp>

int main(array<System::String ^> ^args)
{
    return 0;
}

I get 38 errors and 4 warnings

I've specified all 3 folders with include files path: enter image description here

And lib files directory: enter image description here

As well as debug .lib files: enter image description here

The selected platform is Win32 and*.lib's are x86, so I think the problem differs from this, where x64 ones were used.

I can create a platform for solution and call it "x64", but cannot switch my project to it:

enter image description here

Community
  • 1
  • 1
user2136963
  • 2,526
  • 3
  • 22
  • 41
  • 2
    you can't link to vc10 libs using vs2008, you have to use those from the vc9 folder (if that exists) – berak Aug 31 '14 at 15:49
  • 4
    then you will have to get cmake , and recompile from src. also, do yourself a favour, when trying out, *avoid* cli/managed c++. start with an *empty* project – berak Aug 31 '14 at 15:52
  • 3
    update your vs. that's the most easy solution. – berak Aug 31 '14 at 15:54
  • Thank you. But what's wrong with managed c++? – user2136963 Aug 31 '14 at 17:56
  • 1
    opencv is *stack* based (RAII, refcounted objects), cli is all about pointers and gc. does not play well together. you can't even imread() an image with a bloody String^ , so please avoid all of it. – berak Sep 01 '14 at 00:07

1 Answers1

2

As berak said, it's easier to get a Visual C++ 2010. To use opencv 2.4.9 with MVC++ 2008 one should recompile the library from sources

user2136963
  • 2,526
  • 3
  • 22
  • 41