Compile Errors - windows.h and System::Windows::Forms conflict I am having problems getting my VC++ code to compile. Below are the files as they are defined.
I am using win 2K, VC++ .NET
nidaq.h
**************************************************************************************
#include "stdafx.h"
#include "ChartForm.h"
#ifndef _NIDAQ_Header_
#define _NIDAQ_Header_
/*************************************************************************
*
* NI-DAQ Windows - Function Prototypes
* Copyright (C) National Instruments 1995.
*
*************************************************************************/
#include <windows.h>
...
*************************************************************************************
ChartForm.h
*************************************************************************************
#ifndef CHART_FORM_H
#define CHART_FORM_H
#include <tchar.h>
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
#using <ChartFX.dll>
#using <ChartFX.Base.dll>
#using <ChartFX.Borders.dll>
using namespace System;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System:rawing;
using namespace SoftwareFX::ChartFX;
...
*************************************************************************************
ChartForm.cpp
**************************************************************************************
#include "stdafx.h"
#include "nidaq.h"
#include "ChartForm.h"
I am not sure how to move forward, nidaq.h needs windows.h to compile correctly. But this is causing the conflict. I am not sure how to get around this
Warnings/Errors:
C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxv_w32.h(18) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7374) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : System::Windows::Forms::IDataObject IDataObject'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING
Trial\NarwalChart\ChartForm.h(12) : System::Windows::Forms::IDataObject'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7388) : error C2371: 'IDataObject' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : see declaration of 'IDataObject'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7851) : error C2872: 'IMessageFilter' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : System::Windows::Forms::IMessageFilter IMessageFilter'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING Trial\NarwalChart\ChartForm.h(12) : System::Windows::Forms::IMessageFilter'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7897) :
error C2371: 'IMessageFilter' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : see declaration of 'IMessageFilter'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\OleIdl.h(641) : error C3383: 'IOleCache2::UpdateCache' : in an unmanaged class, a virtual member function cannot have a managed type in the signature
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\OleIdl.h(799) : error C3383: 'IOleCacheControl::OnRun' : in an unmanaged class, a virtual member function cannot have a managed type in the signature
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : warning C4935: assembly access specifier modified from 'public'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(92) : error C2872: 'IServiceProvider' : ambiguous symbol
could be 'c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : System::IServiceProvider IServiceProvider'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING Trial\NarwalChart\ChartForm.h(7) : System::IServiceProvider'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(99) : error C2371: 'IServiceProvider' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : see declaration of 'IServiceProvider'
Is there a way to make the symbols explicitly know which definition to use?
Any assistance would be greatly appreciated.
Delali Dzirasa
I am using win 2K, VC++ .NET
nidaq.h
**************************************************************************************
#include "stdafx.h"
#include "ChartForm.h"
#ifndef _NIDAQ_Header_
#define _NIDAQ_Header_
/*************************************************************************
*
* NI-DAQ Windows - Function Prototypes
* Copyright (C) National Instruments 1995.
*
*************************************************************************/
#include <windows.h>
...
*************************************************************************************
ChartForm.h
*************************************************************************************
#ifndef CHART_FORM_H
#define CHART_FORM_H
#include <tchar.h>
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
#using <ChartFX.dll>
#using <ChartFX.Base.dll>
#using <ChartFX.Borders.dll>
using namespace System;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System:rawing;
using namespace SoftwareFX::ChartFX;
...
*************************************************************************************
ChartForm.cpp
**************************************************************************************
#include "stdafx.h"
#include "nidaq.h"
#include "ChartForm.h"
I am not sure how to move forward, nidaq.h needs windows.h to compile correctly. But this is causing the conflict. I am not sure how to get around this
Warnings/Errors:
C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxv_w32.h(18) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : warning C4935: assembly access specifier modified from 'public'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7374) : error C2872: 'IDataObject' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : System::Windows::Forms::IDataObject IDataObject'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING
Trial\NarwalChart\ChartForm.h(12) : System::Windows::Forms::IDataObject'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7388) : error C2371: 'IDataObject' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(248) : see declaration of 'IDataObject'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7851) : error C2872: 'IMessageFilter' : ambiguous symbol
could be 'C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : System::Windows::Forms::IMessageFilter IMessageFilter'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING Trial\NarwalChart\ChartForm.h(12) : System::Windows::Forms::IMessageFilter'
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(7897) :
error C2371: 'IMessageFilter' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ObjIdl.h(260) : see declaration of 'IMessageFilter'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\OleIdl.h(641) : error C3383: 'IOleCache2::UpdateCache' : in an unmanaged class, a virtual member function cannot have a managed type in the signature
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\OleIdl.h(799) : error C3383: 'IOleCacheControl::OnRun' : in an unmanaged class, a virtual member function cannot have a managed type in the signature
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : warning C4935: assembly access specifier modified from 'public'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(92) : error C2872: 'IServiceProvider' : ambiguous symbol
could be 'c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : System::IServiceProvider IServiceProvider'
or 'c:\Documents and Settings\dzirad1.JHUAPL\Desktop\CHARTING Trial\NarwalChart\ChartForm.h(7) : System::IServiceProvider'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(99) : error C2371: 'IServiceProvider' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ServProv.h(47) : see declaration of 'IServiceProvider'
Is there a way to make the symbols explicitly know which definition to use?
Any assistance would be greatly appreciated.
Delali Dzirasa