Fork me on GitHub

fatal error C1189: #error : core.hpp header must be compiled as C++

两次opencv工程需要设置为C++编译:找了一半天的解决方法。

I am building a C application that uses OpenCV.

when compiling, I get the following error:

fatal error C1189: #error :  core.hpp header must be compiled as C++

I did not find how to resolve this error.

How to use OpenCV from a C project?

  1. Select the required file.
  2. Launch its properties window
  3. Goto C/C++ -> Advanced, and change Compile as to Compile as C++ Code (/TP)

enter image description here

 

posted @ 2017-01-18 14:26  ranjiewen  阅读(3260)  评论(0编辑  收藏  举报