Visual Studio 2008 application with Winddk 6001.18001

Hi,
I am trying to compile a C++ application in VS2008 usnig Winddk 6001.18001.
First set of errors i get is
2>StdAfx.cpp
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2065: ‘In_opt’ : undeclared identifier
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2146: syntax error : missing ‘)’ before identifier
‘new_handler’
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
warning C4229: anachronism used : modifiers on data are ignored
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2059: syntax error : ‘)’
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(85) :
error C2065: ‘_Size’ : undeclared identifier

This is just the first few lines.
When i checked for In_opt it was present in sal.h for SDK but was
not found in sal.h for the ddk.

I read in a few posts on the net that newer DDK’s have more and more
problems working with VS2008.
Moreover In_opt is a annotation newly introduced in VS2008 hence is
absent from DDK headers.

Can anyone please help me figure out a way out of this?

regards
Abhijit

I’m not clear what it is that you’re trying to accomplish here:

  1. Are you trying to build an application that was written in VC2008 with the WDK?
  2. Are you trying to build a driver that was built with the WDK using VS2008?

Also, why are you doing this in the first place?

mm

abhijit ayarekar wrote:

Hi,
I am trying to compile a C++ application in VS2008 usnig Winddk 6001.18001.
First set of errors i get is
2>StdAfx.cpp
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2065: ‘In_opt’ : undeclared identifier
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2146: syntax error : missing ‘)’ before identifier
‘new_handler’
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
warning C4229: anachronism used : modifiers on data are ignored
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2059: syntax error : ‘)’
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(85) :
error C2065: ‘_Size’ : undeclared identifier

This is just the first few lines.
When i checked for In_opt it was present in sal.h for SDK but was
not found in sal.h for the ddk.

I read in a few posts on the net that newer DDK’s have more and more
problems working with VS2008.
Moreover In_opt is a annotation newly introduced in VS2008 hence is
absent from DDK headers.

Can anyone please help me figure out a way out of this?

regards
Abhijit

I have a wireless ndis driver built and the application is a client application to configure the driver.
This is something i received as a continuation work started by someone else.
So the application somehow tries to include and link to ddk headers.
I figured the code was compiled and working with older version of ddk and VS 2005.
I have the newer version of ddk 6001.18001 and VS 2008.
I checked for a few posts on internet and only could get to knowing that
error C2065: ‘In_opt’ : undeclared identifier
is specific to VS 2008 compiler since In_opt is a change for VS 2008

abhijit ayarekar wrote:

I am trying to compile a C++ application in VS2008 usnig Winddk 6001.18001.
First set of errors i get is
2>StdAfx.cpp
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2065: ‘In_opt’ : undeclared identifier
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2146: syntax error : missing ‘)’ before identifier
‘new_handler’
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
warning C4229: anachronism used : modifiers on data are ignored
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(60) :
error C2059: syntax error : ‘)’
1>D:\Program Files\Microsoft Visual Studio 9.0\VC\include\new.h(85) :
error C2065: ‘_Size’ : undeclared identifier

This is just the first few lines.
When i checked for In_opt it was present in sal.h for SDK but was
not found in sal.h for the ddk.

…which certainly suggests to me that you need to rearrange your include
paths. As I see it, you have two choices. One, rearrange the include
paths so that the Platform SDK paths appears before the DDK paths. That
way, you’ll pull the Platform SDK version of sal.h, not the DDK
version. Two, eliminate the Platform SDK paths altogether. Everything
you need should be in the DDK.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

The application is also using atl component and mfc.
It includes afx.h and atlbase.h
I guess using only ddk headers wont get me through in this case.
I tried compiling using only ddk headers.
Actually the whole application comprises of a com object, a console utiity and a mfc dialog utility, both the utilities use the com object.

xxxxx@gmail.com wrote:

The application is also using atl component and mfc.
It includes afx.h and atlbase.h
I guess using only ddk headers wont get me through in this case.

“You guess”? Do you find that to be productive?

DDK 6001.18002 includes a rather old version of MFC, but it (and ATL)
are both present. Did you look?

I tried compiling using only ddk headers.
Actually the whole application comprises of a com object, a console utiity and a mfc dialog utility, both the utilities use the com object

Well, then, you will have to use your brain.

In an app like that, it’s very likely that there are only a few files
that need any DDK headers. So, remove those headers from your stdafx.h
and move them into those specific files. Remove the DDK header paths
from the rest of the project, and manipulate the paths for those few
files separately.

As a last resort, you can copy the few files you need directly into your
project, and eliminate the DDK header paths altogether.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Got it working :slight_smile:
As tim said in previous post, i made sure that the application links to ddk headers only and not use any of the sdk source packed with ddk for mfc/atl. It worked just fine.
Thanks for all the help :).