包括windows.h导致编译问题 [英] including windows.h causing compiler problems

查看:74
本文介绍了包括windows.h导致编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我不知道这是不是正确的问题,但我创建了一个用于操作串口的c ++ CLR项目。我在这里使用Win32函数,因为System :: IO :: Serialport没有我需要的一切。即将DTR和RTS线设置为常高,我无法在System :: IO中找到任何位置,因此我使用"SetCommState(hCom,& dcb);"我记得在依赖项对话框中启用了$(NOINHERIT),因此它使用标准库但是除非我使用#include< windows.h>,否则生成设备不存在。但是当我编译时我得到这个.."错误3错误C2872:'IDataObject':模糊符号C:\Program Files \ Mysoftoft SDKs \ Windows \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ;

有没有办法解决这个问题,或者我将不得不开始一个新项目?如果这是在错误的论坛我很抱歉,在这种情况下我会问主持人将其放在正确的论坛而不是删除它。
谢谢你

Hello. I don't know if this is the right problem but i created a c++ CLR project for manipulating the serial port. I use Win32 functions in this because the System::IO::Serialport doesn't have everything I need. namely to set DTR and RTS Lines constantly high and I can't find anywhere in the System::IO for that purpose so i use the "SetCommState(hCom, &dcb);" I remember to enable the $(NOINHERIT) in the dependencies dialog so it uses standard libraries but
creatdevice is not there unless i use #include <windows.h> but when i compile i get this.. "Error    3    error C2872: 'IDataObject' : ambiguous symbol    C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h    5934    ft8x6"

Is there any way of getting round this or am I going to have to start a new project? My apologies if this is in the wrong forum and I ask in that case the moderators place it in the right forum rather than deleting it.
Thank you


推荐答案

我遇到了同样的问题。
I had same problem with you.


这篇关于包括windows.h导致编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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