错误 D8016:“/ZI"和“/clr"命令行选项不兼容 [英] error D8016: '/ZI' and '/clr' command-line options are incompatible

查看:123
本文介绍了错误 D8016:“/ZI"和“/clr"命令行选项不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序出现以下错误:

I am getting the following error in my program:

  error D8016: '/ZI' and '/clr' command-line options are incompatible

当我在配置中添加以下几行并启用公共运行时会发生这种情况->常规(如果我不启用它,那么错误将出现在使用 system 和 System::Drawing )

This happens when I put the following lines and enable common runtime in configuration->General (If I dont enable it then the error will come at using system and System::Drawing )

#using <system.drawing.dll>
using namespace System;
using namespace System::Drawing;

实际上,我将在我的代码中使用一些需要上述 dll 的 Windows 库.

Actually I will be using some windows library in my code that requires the above dll.

如何解决这个问题?

#include "opencv2/highgui/highgui.hpp"
#include <opencv2/imgproc/imgproc_c.h>
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <ctype.h>
#using <system.drawing.dll>
using namespace System;
using namespace System::Drawing;
using namespace std;

int main( int argc, char** argv )
{
IplImage *source = cvLoadImage( "Image.bmp");
// Here we retrieve a percentage value to a integer
int percent =20;
// declare a destination IplImage object with correct size, depth and channels
  IplImage *destination = cvCreateImage
( cvSize((int)((source->width*percent)/100) , (int)((source->height*percent)/100) ),
                                 source->depth, source->nChannels );
//use cvResize to resize source to a destination image
cvResize(source, destination);
// save image with a name supplied with a second argument
   cvShowImage("new:",destination);
  cvWaitKey(0);
 return 0;
 }

推荐答案

在visual studio中关闭/ZI:

In visual studio to turn off /ZI:

  1. 打开项目的属性页"对话框.
  2. 点击 C/C++ 文件夹.
  3. 单击常规"属性页.
  4. 修改调试信息格式属性 - 将其设置为无"

这篇关于错误 D8016:“/ZI"和“/clr"命令行选项不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆