I’m building a sample driver using winddk 6001.18002. though I include all the paths to files, still it gives me compilation error for atlbase.h. I’m not sure what is the problem and how to debug it. Below is the INCLUDES section from SOURCES file. Any help appreciated!
INCLUDES=\
$(INCLUDES); \
$(ATLMFC_INC_PATH); \ # this is where the atlbase.h - path is set to c:\program files\microsoft visual studio 8\vc\atlmfc\include
$(ATL_INC_PATH); \
$(DDK_INC_PATH); \
$(Include); \
$(MFC_INC_PATH);\
Compile error:
…\stdafx.h (21): error C1083: Cannot open include file: ‘atlbase.h’: No such file or directory
Build.dat entry for atlbase.h file.
D “c:\program files\microsoft visual studio 8\vc\atlmfc\include” 30
F “atlbase.h” 1044 0 7c8abc00 7240 0
I “atldef.h” 0 0
I “winsock2.h” 0 0
I “atlcore.h” 0 0
I “ole2.h” 0 0
I “atlcomcli.h” 0 0
I “comcat.h” 0 0
I “stddef.h” 0 0
I “tchar.h” 0 0
I “limits.h” 0 0
I “olectl.h” 0 0
I “atliface.h” 0 0
I “errno.h” 0 0
I “process.h” 0 0
I “stdio.h” 0 0
I “stdarg.h” 0 0
I “atlconv.h” 0 0
I “shlwapi.h” 0 0
I “atlsimpcoll.h” 0 0
I “atltrace.h” 0 0
I “atlexcept.h” 0 0
I “atlassem.h” 0 0
I “statreg.h” 0 0
I “atlplus.h” 0 0
I “atlbase.inl” 0 0
F “stdafx.h” 1044 0 7dfd2700 254 0
I “resource.h” 1 0
I “stdio.h” 0 0
I “atlbase.h” 0 0 # what is this 0 0 means?
I “atlcom.h” 0 0
I “atlcoll.h” 0 0
I “atlstr.h” 0 0
I “cmath” 0 0
I “dbt.h” 0 0
I “setupapi.h” 0 0
I “cfgmgr32.h” 0 0
I “devguid.h” 0 0
[email protected]
wrote:
I’m building a sample driver using winddk 6001.18002. though I include all the paths to files, still it gives me compilation error for atlbase.h. I’m not sure what is the problem and how to debug it. Below is the INCLUDES section from SOURCES file. Any help appreciated!
INCLUDES=\
$(INCLUDES); \
$(ATLMFC_INC_PATH); \ # this is where the atlbase.h - path is set to c:\program files\microsoft visual studio 8\vc\atlmfc\include
You shouldn’t do that. The DDK includes a copy of ATL, and that’s the
only one supported for DDK-based apps. Get rid of the INCLUDES clause,
and add these lines to your “sources” file:
USE_ATL=1
ATL_VER=70
Are you building a user-mode driver? ATL is not particularly useful in
a kernel driver.
Tim Roberts,
[email protected]
Providenza & Boekelheide, Inc.
Hi Tim
Thanks for your time and providing the resolution. I’ve included the DDK path to CRT_INC_PATH and it worked. Now I’m getting other errors. But will take care of it.
I’m building a driver for portable device (WPD) and it is a user mode dll. This project runs in VS2005 well, but would like to run PREfast and this is the reason creating SOURCES and then complile with PREfast.
I’m curious what USE_ATL=1, ATL_VER=70 will correspond to? I thought of using the DDK path only earlier, but couldn’t do it as the atlbase.h file is located in 3 places under WinDDK.
Thank you once again for the help.
Regards
Shyam
Well, the answer is buried in makefile.new, but it just defines a number of ATL related macros:
ATL_INCLUDES=$(ATL_INC_ROOT)\atl$(ATL_VER)
ATL_DEFINES=/D_ATL_DLL
ATL_LIBS=$(ATL_LIB_PATH)\atl.lib $(ADDITIONAL_ATL_LIBS)
LIBC_LIB = $(ATL_STATIC_LIBS) $(LIBC_LIB) $(ATL_LIBS)
MFC_DEFINES = $(MFC_DEFINES) $(ATL_DEFINES)
[email protected]
wrote:
Well, the answer is buried in makefile.new, but it just defines a number of ATL related macros:
Yes. The ultimate answer to virtually all “sources” questions is in the
DDK, in bin\makefile.new and bin\i386mk.inc (or bin\amd64mk.inc).
Tim Roberts,
[email protected]
Providenza & Boekelheide, Inc.
You can always look in the build*.log file as well. you can clearly see the additional include directories
-----Original Message-----
From:
[email protected]
[
mailto:[email protected]
] On Behalf Of
[email protected]
Sent: Friday, July 10, 2009 2:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] winddk build error for atlbase.h file
Well, the answer is buried in makefile.new, but it just defines a number of ATL related macros:
ATL_INCLUDES=$(ATL_INC_ROOT)\atl$(ATL_VER)
ATL_DEFINES=/D_ATL_DLL
ATL_LIBS=$(ATL_LIB_PATH)\atl.lib $(ADDITIONAL_ATL_LIBS)
LIBC_LIB = $(ATL_STATIC_LIBS) $(LIBC_LIB) $(ATL_LIBS) # Piggy back on MFC_DEFINES for now.
MFC_DEFINES = $(MFC_DEFINES) $(ATL_DEFINES)
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Thanks for your help!
this is the first SOURCES compilation for me. my source compiled fine with VS 2005. But I get errors like the below… any tips on how to resolve this? I tried to change the order of include directories but no success. thanks for your help. LoadStringW(…) is in cstring.h under visualstudio include directories but not in winddk…
…error C2664: ‘SetupDiOpenDeviceInterfaceA’ : cannot convert parameter 2 from ‘LPCWSTR’ to ‘PCSTR’
…: error C2039: ‘LoadStringW’ : is not a member of ‘ATL::CStringT’
…: error C2664: ‘void ATL::CStringT::Format(const char *,…)’ : cannot convert parameter 1 from ‘const unsigned short [4]’ to ‘const char *’
I can’t say that I’ve ever used the version of ATL included with the WDK, but I’d say it’s certainly possible that it’s very old and just doesn’t have the features you are using.
[email protected]
wrote:
I can’t say that I’ve ever used the version of ATL included with the WDK, but I’d say it’s certainly possible that it’s very old and just doesn’t have the features you are using.
It turns out that the WDK actually includes 3 different versions of
ATL. Two are very old, but the ATL_VER=70 version is recent enough to
be useful.
Tim Roberts,
[email protected]
Providenza & Boekelheide, Inc.
Hi Shyam,
Did you actually included the macros USE_ATL=1 and ATL_VER=70 in your sources file, or you just ask what they do?
Also since you use older version of WDK you may try with ATL_VER=30.
Hope this helps,
Tanya
Thanks for your help!
this is the first SOURCES compilation for me. my source compiled fine
with VS 2005. But I get errors like the below… any tips on how to
resolve this? I tried to change the order of include directories but
no success. thanks for your help. LoadStringW(…) is in cstring.h
under visualstudio include directories but not in winddk…
…error C2664: ‘SetupDiOpenDeviceInterfaceA’ : cannot convert parameter 2
from ‘LPCWSTR’ to ‘PCSTR’
…: error C2039: ‘LoadStringW’ : is not a member of
‘ATL::CStringT’
>
> …: error C2664: ‘void ATL::CStringT::Format(const
> char *,…)’ : cannot convert parameter 1 from ‘const unsigned short [4]’ to
> ‘const char *’
It should be obvious that the problem is a UNICODE confusion. You are using
Unicode strings, but you have not defined the UNICODE symbol. Your
Visual Studio project has probably done that for you.
C_DEFINES = $(C_DEFINES) -DUNICODE
–
Tim Roberts,
[email protected]
Providenza & Boeklheide, Inc.
> …\stdafx.h (21): error C1083: Cannot open include file: ‘atlbase.h’: No such file or directory
Add this to SOURCES:
USE_STATIC_ATL=1
ATL_VER=30
USE_NATIVE_EH=1
Maxim S. Shatskih
Windows DDK MVP
[email protected]
http://www.storagecraft.com