winapi - 错误 D8016 : '/ZI' and '/clr' command-line options are incompatible

标签 winapi visual-c++ opencv

我的程序出现以下错误:

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

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

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

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

如何解决这个问题?

#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:

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

关于winapi - 错误 D8016 : '/ZI' and '/clr' command-line options are incompatible,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13331318/

相关文章:

c++ - 类似项目中的 MessageBox 行为

image-processing - 以下用于图像调整大小的 c++ 双三次插值代码有什么问题

c++ - 如何为 dll 设置入口点

.net - 应用程序重新启动 API 不会重新启动失败的应用程序

c++ - (key, value)对结构的内存分配,并从注册表中读取

visual-studio-2008 - 使用 VC++ 2008 为 XP 构建屏幕保护程序

c++ - FindResource Api 为 DLL 中的文本文件提供错误 1813

c++ - sal 缓冲区注释上的额外下划线 ( _ ) 是什么?

c++ - OpenCV 从一组点绘制一条线

圆形检测