首页 > 技术文章 > fatal error C1189: #error : core.hpp header must be compiled as C++

ranjiewen 2017-01-18 14:26 原文

两次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

 

推荐阅读