I am using the Windows Driver Kit (WinDDK 6001.18001) to build my userspace application rather than Visual Studio 2005. I am taking this approach because we also have to build driver components, so I'd prefer to have a single build environment to build everything. Microsoft itself uses this approach for several products.
This was working fine until I started using Boost 1.38.0. I'm not using C++ in the kernel mode components, just the userspace applications. In C++ code, it's natural to use the boost libraries. Unfortunately, the WDK doesn't agree.
The first error I noticed is that "#include <cstddef>" doesn't put ptrdiff_t
in the std namespace, as seems required by Annex D. Working around this left several errors in boost\lambda\detail\operator_return_type_traits.hpp
about error C2976: 'std::basic_string' : too few template arguments.
It appears redundant with iostream.
Has anyone successfully gotten the combination of Boost, iostream, and the WDK to work together?
My sources file:
TARGETNAME=foobar
TARGETTYPE=PROGRAM
USE_MSVCRT = 1
USE_STL = 1
USE_ATL = 1
ATL_VER = 30
STL_VER = 70
USE_NATIVE_EH = 1
USE_IOSTREAM = 1
SUBSYSTEM_VERSION = 5.02
C_DEFINES = \
-D_MT \
-DWIN_32 \
-DWIN32 \
-D_WINDOWS \
-DNT \
-D_WIN32_DCOM \
-DUNICODE \
-D_UNICODE \
-D_ATL_NO_DEBUG_CRT # because we are using USE_MSVCRT=1
SOURCES=service.cpp
INCLUDES=\
$(BOOST_INC_PATH)
TARGETLIBS=\
$(SDK_LIB_PATH)\ole32.lib \
$(SDK_LIB_PATH)\oleaut32.lib \
$(SDK_LIB_PATH)\uuid.lib \
UMTYPE=console
UMBASE=0x400000
service.cpp:
#include <iostream>
#include <cstddef>
namespace std {
typedef ::ptrdiff_t ptrdiff_t; // DDK C++ workaround
}
#include <boost/lambda/lambda.hpp>
int __cdecl main() {
return 0;
}