Win 2003 DDK Build Query

NEWBIE IN THE OCEAN (12) DEPT
Hi All,
I am new to this list and am trying to build a 32 bit application on
Windows 2003 using the Build utility provided in Windows 2003 DDK
version 3790. My Application makes calls to a driver which I have
successfully built using the Build utility. However when I try to
compile and link my application I find this error:

LINK : error LNK1218: warning treated as error; no output file generated
BUILD: Done
10 files compiled
1 executable built - 1 Warning - 1 Error

I have included the LINKER_FLAGS macro in my sources file yet am
unable to override the default linking options.
I would like to know :

  1. If it is possible to suppress the linker warnings. I am assuming
    that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
    not suppressing linker warnings.
  2. My application has to include “ntddk.h” for some definitions. Is
    this causing the linker to view my application as a device driver and
    tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
    defined in my application.

As such I have posted a long mail but please do have a look at my
sources file and the log file generated.

P.S. This application used to compile and link perfectly on Windows
2000 in VC6.0 environment.

Thanks and Regds,

  • Saurabh

Sources File

TARGETNAME=Analyzer
TARGETPATH=obj
TARGETTYPE=PROGRAM
MSC_OPTIMIZATION=/EHsc
MSC_WARNING_LEVEL=/W0

TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
$(DDK_LIB_PATH)\user32.lib
$(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
$(DDK_LIB_PATH)\winspool.lib
$(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
$(DDK_LIB_PATH)\shell32.lib
$(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib $(DDK_LIB_PATH)\uuid.lib
$(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
$(DDK_LIB_PATH)\psapi.lib

SOURCES=MainApplication.cpp \
stdafx.cpp \
Analyzer.cpp \
argcargv.cpp \
Arguments.cpp \
Dynamic.cpp \
NtQuery.cpp \
Util.cpp \
analyzer.sys \
analyzer.rc

INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include

USE_INCREMENTAL_LINKING=1
LINKER_FLAGS=/subsystem:console


buildfre_wnet_x86.log

BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry: analyzer.sys
BUILD: Examining c:\analyzer\application directory for files to compile.
Compiling c:\analyzer\application directory ********************
‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
-DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
-DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”"
-DSXS_TARGET=“”“Analyzer.exe”“”
-DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=“”“Microsoft.Windows.SystemCompatible”“”
-DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"““Microsoft.Windows.SystemCompatible””"
-z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
-DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
-DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
-DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D__BUILDMACHINE__=WinDDK -DFPO=1
-DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
-IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
-IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
-IC:\WINDDK\3790\inc\crt .\analyzer.rc
cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
-IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
-Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
-IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
-DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
-D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
-D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
-D__BUILDMACHINE__=WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
/Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
-FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
.\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
.\dynamic.cpp .\ntquery.cpp .\util.cpp
mainapplication.cpp
stdafx.cpp
analyzer.cpp
argcargv.cpp
arguments.cpp
dynamic.cpp
ntquery.cpp
util.cpp
Generating Code…

Stop.
Linking c:\analyzer\application directory ********************
‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1’
link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
@C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
Microsoft (R) Incremental Linker Version 7.10.2179
Copyright (C) Microsoft Corporation. All rights reserved.

/subsystem:console
-MERGE:_PAGE=PAGE
-MERGE:_TEXT=.text
-SECTION:INIT,d
-OPT:NOREF
-IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
-NODEFAULTLIB
/WX
-debug:FULL
-debugtype:cv
-version:5.2
-osversion:5.2
/opt:nowin98
-merge:.rdata=.text
-STACK:0x40000,0x2000
-subsystem:native,5.02
-base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
-entry:NtProcessStartup@4
objfre_wnet_x86\i386\analyzer.res
objfre_wnet_x86\i386\mainapplication.obj
objfre_wnet_x86\i386\stdafx.obj
objfre_wnet_x86\i386\analyzer.obj
objfre_wnet_x86\i386\argcargv.obj
objfre_wnet_x86\i386\arguments.obj
objfre_wnet_x86\i386\dynamic.obj
objfre_wnet_x86\i386\ntquery.obj
objfre_wnet_x86\i386\util.obj
C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
C:\WINDDK\3790\lib\wnet\i386\nt.lib
C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
C:\WINDDK\3790\lib\wnet\i386\user32.lib
C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
C:\WINDDK\3790\lib\wnet\i386\winspool.lib
C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
C:\WINDDK\3790\lib\wnet\i386\shell32.lib
C:\WINDDK\3790\lib\wnet\i386\ole32.lib
C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
C:\WINDDK\3790\lib\wnet\i386\uuid.lib
C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
C:\WINDDK\3790\lib\wnet\i386\psapi.lib
/Tmp
advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
or /SUBSYSTEM:WINDOWS.
LINK : error LNK1218: warning treated as error; no output file generated
echo Skip Binplace:
Skip Binplace:

Stop.

You should not be including NTDDK.H in an application source file. You can
include certain header files from the DDK such as NTDDSCSI.H
but NTDDK.H is basically a no no.


The personal opinion of
Gary G. Little

“saurabh agrawal” wrote in message
news:xxxxx@ntdev…
> NEWBIE IN THE OCEAN (12) DEPT
> Hi All,
> I am new to this list and am trying to build a 32 bit application on
> Windows 2003 using the Build utility provided in Windows 2003 DDK
> version 3790. My Application makes calls to a driver which I have
> successfully built using the Build utility. However when I try to
> compile and link my application I find this error:
>
> LINK : error LNK1218: warning treated as error; no output file generated
> BUILD: Done
> 10 files compiled
> 1 executable built - 1 Warning - 1 Error
>
> I have included the LINKER_FLAGS macro in my sources file yet am
> unable to override the default linking options.
> I would like to know :
> 1) If it is possible to suppress the linker warnings. I am assuming
> that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
> not suppressing linker warnings.
> 2) My application has to include “ntddk.h” for some definitions. Is
> this causing the linker to view my application as a device driver and
> tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
> defined in my application.
>
> As such I have posted a long mail but please do have a look at my
> sources file and the log file generated.
>
> P.S. This application used to compile and link perfectly on Windows
> 2000 in VC6.0 environment.
>
> Thanks and Regds,
> - Saurabh
>
> Sources File
> -----------------------------------------------------------
> TARGETNAME=Analyzer
> TARGETPATH=obj
> TARGETTYPE=PROGRAM
> MSC_OPTIMIZATION=/EHsc
> MSC_WARNING_LEVEL=/W0
>
>
> TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
> $(DDK_LIB_PATH)\user32.lib
> $(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
> $(DDK_LIB_PATH)\winspool.lib
> $(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
> $(DDK_LIB_PATH)\shell32.lib
> $(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib
$(DDK_LIB_PATH)\uuid.lib
> $(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
> $(DDK_LIB_PATH)\psapi.lib
>
> SOURCES=MainApplication.cpp <br>> stdafx.cpp <br>> Analyzer.cpp <br>> argcargv.cpp <br>> Arguments.cpp <br>> Dynamic.cpp <br>> NtQuery.cpp <br>> Util.cpp <br>> analyzer.sys <br>> analyzer.rc
>
>
> INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include
>
> USE_INCREMENTAL_LINKING=1
> LINKER_FLAGS=/subsystem:console
>
> --------------------------------------------------------------------------
--------------------------
>
> buildfre_wnet_x86.log
> --------------------------------
> BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
analyzer.sys
> BUILD: Examining c:\analyzer\application directory for files to compile.
> Compiling c:\analyzer\application directory
> ‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
> rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
> -DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
> -DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”“
> -DSXS_TARGET=”““Analyzer.exe””“
> -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=”““Microsoft.Windows.SystemCompatible””“
> -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L”““Microsoft.Windows.SystemCompatible
””"
> -z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
> objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
> -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
> -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
> -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D BUILDMACHINE =WinDDK -DFPO=1
> -DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
> -IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\crt .\analyzer.rc
> cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
> -IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
> -Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
> -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
> -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
> -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
> -D BUILDMACHINE =WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
> /Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
> -FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
> .\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
> .\dynamic.cpp .\ntquery.cpp .\util.cpp
> mainapplication.cpp
> stdafx.cpp
> analyzer.cpp
> argcargv.cpp
> arguments.cpp
> dynamic.cpp
> ntquery.cpp
> util.cpp
> Generating Code…
>
> Stop.
> Linking c:\analyzer\application directory

> ‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
386=1’
> link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
> @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
> Microsoft (R) Incremental Linker Version 7.10.2179
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> /subsystem:console
> -MERGE:_PAGE=PAGE
> -MERGE:_TEXT=.text
> -SECTION:INIT,d
> -OPT:NOREF
> -IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
> -NODEFAULTLIB
> /WX
> -debug:FULL
> -debugtype:cv
> -version:5.2
> -osversion:5.2
> /opt:nowin98
> -merge:.rdata=.text
> -STACK:0x40000,0x2000
> -subsystem:native,5.02
> -base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
> -entry:NtProcessStartup@4
> objfre_wnet_x86\i386\analyzer.res
> objfre_wnet_x86\i386\mainapplication.obj
> objfre_wnet_x86\i386\stdafx.obj
> objfre_wnet_x86\i386\analyzer.obj
> objfre_wnet_x86\i386\argcargv.obj
> objfre_wnet_x86\i386\arguments.obj
> objfre_wnet_x86\i386\dynamic.obj
> objfre_wnet_x86\i386\ntquery.obj
> objfre_wnet_x86\i386\util.obj
> C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\nt.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
> C:\WINDDK\3790\lib\wnet\i386\user32.lib
> C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
> C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
> C:\WINDDK\3790\lib\wnet\i386\winspool.lib
> C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
> C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
> C:\WINDDK\3790\lib\wnet\i386\shell32.lib
> C:\WINDDK\3790\lib\wnet\i386\ole32.lib
> C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
> C:\WINDDK\3790\lib\wnet\i386\uuid.lib
> C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
> C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
> C:\WINDDK\3790\lib\wnet\i386\psapi.lib
> /Tmp
> advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
> specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
> or /SUBSYSTEM:WINDOWS.
> LINK : error LNK1218: warning treated as error; no output file generated
> echo Skip Binplace:
> Skip Binplace:
>
> Stop.
>

In my experience, the DDK headers I had to include for some applications
that dealt with drivers were crafted so they only included struct
definitions and ioctl codes. If you want to interact with your own driver
with your own ioctl definitions (as it seems to be), then you don’t even
need to include ntddk.h.

Mat

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Wednesday, December 08, 2004 12:58 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Win 2003 DDK Build Query

You should not be including NTDDK.H in an application source file. You can
include certain header files from the DDK such as NTDDSCSI.H
but NTDDK.H is basically a no no.


The personal opinion of
Gary G. Little

“saurabh agrawal” wrote in message
news:xxxxx@ntdev…
> NEWBIE IN THE OCEAN (12) DEPT
> Hi All,
> I am new to this list and am trying to build a 32 bit application on
> Windows 2003 using the Build utility provided in Windows 2003 DDK
> version 3790. My Application makes calls to a driver which I have
> successfully built using the Build utility. However when I try to
> compile and link my application I find this error:
>
> LINK : error LNK1218: warning treated as error; no output file generated
> BUILD: Done
> 10 files compiled
> 1 executable built - 1 Warning - 1 Error
>
> I have included the LINKER_FLAGS macro in my sources file yet am
> unable to override the default linking options.
> I would like to know :
> 1) If it is possible to suppress the linker warnings. I am assuming
> that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
> not suppressing linker warnings.
> 2) My application has to include “ntddk.h” for some definitions. Is
> this causing the linker to view my application as a device driver and
> tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
> defined in my application.
>
> As such I have posted a long mail but please do have a look at my
> sources file and the log file generated.
>
> P.S. This application used to compile and link perfectly on Windows
> 2000 in VC6.0 environment.
>
> Thanks and Regds,
> - Saurabh
>
> Sources File
> -----------------------------------------------------------
> TARGETNAME=Analyzer
> TARGETPATH=obj
> TARGETTYPE=PROGRAM
> MSC_OPTIMIZATION=/EHsc
> MSC_WARNING_LEVEL=/W0
>
>
> TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
> $(DDK_LIB_PATH)\user32.lib
> $(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
> $(DDK_LIB_PATH)\winspool.lib
> $(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
> $(DDK_LIB_PATH)\shell32.lib
> $(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib
$(DDK_LIB_PATH)\uuid.lib
> $(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
> $(DDK_LIB_PATH)\psapi.lib
>
> SOURCES=MainApplication.cpp <br>> stdafx.cpp <br>> Analyzer.cpp <br>> argcargv.cpp <br>> Arguments.cpp <br>> Dynamic.cpp <br>> NtQuery.cpp <br>> Util.cpp <br>> analyzer.sys <br>> analyzer.rc
>
>
> INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include
>
> USE_INCREMENTAL_LINKING=1
> LINKER_FLAGS=/subsystem:console
>
> --------------------------------------------------------------------------
--------------------------
>
> buildfre_wnet_x86.log
> --------------------------------
> BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
analyzer.sys
> BUILD: Examining c:\analyzer\application directory for files to compile.
> Compiling c:\analyzer\application directory
> ‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
> rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
> -DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
> -DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”“
> -DSXS_TARGET=”““Analyzer.exe””“
> -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=”““Microsoft.Windows.SystemCompatible””“
> -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L”““Microsoft.Windows.SystemCompatible
””"
> -z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
> objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
> -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
> -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
> -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D BUILDMACHINE =WinDDK -DFPO=1
> -DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
> -IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\crt .\analyzer.rc
> cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
> -IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
> -Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
> -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
> -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
> -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
> -D BUILDMACHINE =WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
> /Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
> -FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
> .\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
> .\dynamic.cpp .\ntquery.cpp .\util.cpp
> mainapplication.cpp
> stdafx.cpp
> analyzer.cpp
> argcargv.cpp
> arguments.cpp
> dynamic.cpp
> ntquery.cpp
> util.cpp
> Generating Code…
>
> Stop.
> Linking c:\analyzer\application directory

> ‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
386=1’
> link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
> @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
> Microsoft (R) Incremental Linker Version 7.10.2179
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> /subsystem:console
> -MERGE:_PAGE=PAGE
> -MERGE:_TEXT=.text
> -SECTION:INIT,d
> -OPT:NOREF
> -IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
> -NODEFAULTLIB
> /WX
> -debug:FULL
> -debugtype:cv
> -version:5.2
> -osversion:5.2
> /opt:nowin98
> -merge:.rdata=.text
> -STACK:0x40000,0x2000
> -subsystem:native,5.02
> -base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
> -entry:NtProcessStartup@4
> objfre_wnet_x86\i386\analyzer.res
> objfre_wnet_x86\i386\mainapplication.obj
> objfre_wnet_x86\i386\stdafx.obj
> objfre_wnet_x86\i386\analyzer.obj
> objfre_wnet_x86\i386\argcargv.obj
> objfre_wnet_x86\i386\arguments.obj
> objfre_wnet_x86\i386\dynamic.obj
> objfre_wnet_x86\i386\ntquery.obj
> objfre_wnet_x86\i386\util.obj
> C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\nt.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
> C:\WINDDK\3790\lib\wnet\i386\user32.lib
> C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
> C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
> C:\WINDDK\3790\lib\wnet\i386\winspool.lib
> C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
> C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
> C:\WINDDK\3790\lib\wnet\i386\shell32.lib
> C:\WINDDK\3790\lib\wnet\i386\ole32.lib
> C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
> C:\WINDDK\3790\lib\wnet\i386\uuid.lib
> C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
> C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
> C:\WINDDK\3790\lib\wnet\i386\psapi.lib
> /Tmp
> advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
> specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
> or /SUBSYSTEM:WINDOWS.
> LINK : error LNK1218: warning treated as error; no output file generated
> echo Skip Binplace:
> Skip Binplace:
>
> Stop.
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@encentrus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

why not just use the VC++ compiler and makefile instead of DDK’s build
utility to compile the application?

-----Original Message-----
From: saurabh agrawal [mailto:xxxxx@gmail.com]
Sent: Wednesday, December 08, 2004 4:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Win 2003 DDK Build Query

NEWBIE IN THE OCEAN (12) DEPT
Hi All,
I am new to this list and am trying to build a 32 bit application on
Windows 2003 using the Build utility provided in Windows 2003 DDK
version 3790. My Application makes calls to a driver which I have
successfully built using the Build utility. However when I try to
compile and link my application I find this error:

LINK : error LNK1218: warning treated as error; no output file generated
BUILD: Done
10 files compiled
1 executable built - 1 Warning - 1 Error

I have included the LINKER_FLAGS macro in my sources file yet am
unable to override the default linking options.
I would like to know :

  1. If it is possible to suppress the linker warnings. I am assuming
    that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
    not suppressing linker warnings.
  2. My application has to include “ntddk.h” for some definitions. Is
    this causing the linker to view my application as a device driver and
    tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
    defined in my application.

As such I have posted a long mail but please do have a look at my
sources file and the log file generated.

P.S. This application used to compile and link perfectly on Windows
2000 in VC6.0 environment.

Thanks and Regds,

  • Saurabh

Sources File

TARGETNAME=Analyzer
TARGETPATH=obj
TARGETTYPE=PROGRAM
MSC_OPTIMIZATION=/EHsc
MSC_WARNING_LEVEL=/W0

TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
$(DDK_LIB_PATH)\user32.lib
$(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
$(DDK_LIB_PATH)\winspool.lib
$(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
$(DDK_LIB_PATH)\shell32.lib
$(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib
$(DDK_LIB_PATH)\uuid.lib
$(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
$(DDK_LIB_PATH)\psapi.lib

SOURCES=MainApplication.cpp \
stdafx.cpp \
Analyzer.cpp \
argcargv.cpp \
Arguments.cpp \
Dynamic.cpp \
NtQuery.cpp \
Util.cpp \
analyzer.sys \
analyzer.rc

INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include

USE_INCREMENTAL_LINKING=1
LINKER_FLAGS=/subsystem:console



buildfre_wnet_x86.log

BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
analyzer.sys
BUILD: Examining c:\analyzer\application directory for files to compile.
Compiling c:\analyzer\application directory ********************
‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
-DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
-DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”"
-DSXS_TARGET=“”“Analyzer.exe”“”
-DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=“”“Microsoft.Windows.SystemCompatible”“”

-DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"““Microsoft.Windows.SystemCompatible””"
-z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
-DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
-DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
-DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D__BUILDMACHINE__=WinDDK -DFPO=1
-DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
-IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
-IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
-IC:\WINDDK\3790\inc\crt .\analyzer.rc
cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
-IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
-Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
-IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
-DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
-D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
-D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
-D__BUILDMACHINE__=WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
/Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
-FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
.\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
.\dynamic.cpp .\ntquery.cpp .\util.cpp
mainapplication.cpp
stdafx.cpp
analyzer.cpp
argcargv.cpp
arguments.cpp
dynamic.cpp
ntquery.cpp
util.cpp
Generating Code…

Stop.
Linking c:\analyzer\application directory ********************
‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1’
link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
@C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
Microsoft (R) Incremental Linker Version 7.10.2179
Copyright (C) Microsoft Corporation. All rights reserved.

/subsystem:console
-MERGE:_PAGE=PAGE
-MERGE:_TEXT=.text
-SECTION:INIT,d
-OPT:NOREF
-IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
-NODEFAULTLIB
/WX
-debug:FULL
-debugtype:cv
-version:5.2
-osversion:5.2
/opt:nowin98
-merge:.rdata=.text
-STACK:0x40000,0x2000
-subsystem:native,5.02
-base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
-entry:NtProcessStartup@4
objfre_wnet_x86\i386\analyzer.res
objfre_wnet_x86\i386\mainapplication.obj
objfre_wnet_x86\i386\stdafx.obj
objfre_wnet_x86\i386\analyzer.obj
objfre_wnet_x86\i386\argcargv.obj
objfre_wnet_x86\i386\arguments.obj
objfre_wnet_x86\i386\dynamic.obj
objfre_wnet_x86\i386\ntquery.obj
objfre_wnet_x86\i386\util.obj
C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
C:\WINDDK\3790\lib\wnet\i386\nt.lib
C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
C:\WINDDK\3790\lib\wnet\i386\user32.lib
C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
C:\WINDDK\3790\lib\wnet\i386\winspool.lib
C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
C:\WINDDK\3790\lib\wnet\i386\shell32.lib
C:\WINDDK\3790\lib\wnet\i386\ole32.lib
C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
C:\WINDDK\3790\lib\wnet\i386\uuid.lib
C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
C:\WINDDK\3790\lib\wnet\i386\psapi.lib
/Tmp
advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
or /SUBSYSTEM:WINDOWS.
LINK : error LNK1218: warning treated as error; no output file generated
echo Skip Binplace:
Skip Binplace:

Stop.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: dsingh@in.rainbow.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib

C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
C:\WINDDK\3790\lib\wnet\i386\user32.lib
C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
C:\WINDDK\3790\lib\wnet\i386\winspool.lib
C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
C:\WINDDK\3790\lib\wnet\i386\shell32.lib
C:\WINDDK\3790\lib\wnet\i386\ole32.lib
C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
C:\WINDDK\3790\lib\wnet\i386\uuid.lib
C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
C:\WINDDK\3790\lib\wnet\i386\psapi.lib
/Tmp
advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
or /SUBSYSTEM:WINDOWS.
LINK : error LNK1218: warning treated as error; no output file generated

Why are you building a driver in kernel space and importing things from
user-mode DLLs?
That generally doesn’t work.

RE: [ntdev] Win 2003 DDK Build Query To simplify the release engineering and testing.
Building the whole product with BUILD is possible, and simplifies the lifecycle a lot.

Also, after you have mastered all problems from the SOURCES file, you can use it as a template (copy/paste) for subsequent SOURCES files.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Dsingh@in.safenet-inc.com
To: Windows System Software Devs Interest List
Sent: Thursday, December 09, 2004 7:26 AM
Subject: RE: [ntdev] Win 2003 DDK Build Query

why not just use the VC++ compiler and makefile instead of DDK’s build utility to compile the application?

-----Original Message-----
From: saurabh agrawal [mailto:xxxxx@gmail.com]
Sent: Wednesday, December 08, 2004 4:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Win 2003 DDK Build Query

NEWBIE IN THE OCEAN (12) DEPT
Hi All,
I am new to this list and am trying to build a 32 bit application on
Windows 2003 using the Build utility provided in Windows 2003 DDK
version 3790. My Application makes calls to a driver which I have
successfully built using the Build utility. However when I try to
compile and link my application I find this error:

LINK : error LNK1218: warning treated as error; no output file generated
BUILD: Done
10 files compiled
1 executable built - 1 Warning - 1 Error

I have included the LINKER_FLAGS macro in my sources file yet am
unable to override the default linking options.
I would like to know :

  1. If it is possible to suppress the linker warnings. I am assuming
    that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
    not suppressing linker warnings.
  2. My application has to include “ntddk.h” for some definitions. Is
    this causing the linker to view my application as a device driver and
    tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
    defined in my application.

As such I have posted a long mail but please do have a look at my
sources file and the log file generated.

P.S. This application used to compile and link perfectly on Windows
2000 in VC6.0 environment.

Thanks and Regds,

  • Saurabh

Sources File

TARGETNAME=Analyzer
TARGETPATH=obj
TARGETTYPE=PROGRAM
MSC_OPTIMIZATION=/EHsc
MSC_WARNING_LEVEL=/W0

TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
$(DDK_LIB_PATH)\user32.lib
$(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
$(DDK_LIB_PATH)\winspool.lib
$(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
$(DDK_LIB_PATH)\shell32.lib
$(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib $(DDK_LIB_PATH)\uuid.lib
$(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
$(DDK_LIB_PATH)\psapi.lib

SOURCES=MainApplication.cpp \
stdafx.cpp \
Analyzer.cpp \
argcargv.cpp \
Arguments.cpp \
Dynamic.cpp \
NtQuery.cpp \
Util.cpp \
analyzer.sys \
analyzer.rc

INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include

USE_INCREMENTAL_LINKING=1
LINKER_FLAGS=/subsystem:console


buildfre_wnet_x86.log

BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry: analyzer.sys
BUILD: Examining c:\analyzer\application directory for files to compile.
Compiling c:\analyzer\application directory ********************
‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
-DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
-DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”"
-DSXS_TARGET=“”“Analyzer.exe”“”
-DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=“”“Microsoft.Windows.SystemCompatible”“”
-DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"““Microsoft.Windows.SystemCompatible””"
-z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
-DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
-DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
-DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D__BUILDMACHINE__=WinDDK -DFPO=1
-DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
-IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
-IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
-IC:\WINDDK\3790\inc\crt .\analyzer.rc
cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
-IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
-Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
-IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
-DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
-D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
-D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
-D__BUILDMACHINE__=WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
/Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
-FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
.\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
.\dynamic.cpp .\ntquery.cpp .\util.cpp
mainapplication.cpp
stdafx.cpp
analyzer.cpp
argcargv.cpp
arguments.cpp
dynamic.cpp
ntquery.cpp
util.cpp
Generating Code…

Stop.
Linking c:\analyzer\application directory ********************
‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1’
link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
@C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
Microsoft (R) Incremental Linker Version 7.10.2179
Copyright (C) Microsoft Corporation. All rights reserved.

/subsystem:console
-MERGE:_PAGE=PAGE
-MERGE:_TEXT=.text
-SECTION:INIT,d
-OPT:NOREF
-IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
-NODEFAULTLIB
/WX
-debug:FULL
-debugtype:cv
-version:5.2
-osversion:5.2
/opt:nowin98
-merge:.rdata=.text
-STACK:0x40000,0x2000
-subsystem:native,5.02
-base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
-entry:NtProcessStartup@4
objfre_wnet_x86\i386\analyzer.res
objfre_wnet_x86\i386\mainapplication.obj
objfre_wnet_x86\i386\stdafx.obj
objfre_wnet_x86\i386\analyzer.obj
objfre_wnet_x86\i386\argcargv.obj
objfre_wnet_x86\i386\arguments.obj
objfre_wnet_x86\i386\dynamic.obj
objfre_wnet_x86\i386\ntquery.obj
objfre_wnet_x86\i386\util.obj
C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
C:\WINDDK\3790\lib\wnet\i386\nt.lib
C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
C:\WINDDK\3790\lib\wnet\i386\user32.lib
C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
C:\WINDDK\3790\lib\wnet\i386\winspool.lib
C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
C:\WINDDK\3790\lib\wnet\i386\shell32.lib
C:\WINDDK\3790\lib\wnet\i386\ole32.lib
C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
C:\WINDDK\3790\lib\wnet\i386\uuid.lib
C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
C:\WINDDK\3790\lib\wnet\i386\psapi.lib
/Tmp
advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
or /SUBSYSTEM:WINDOWS.
LINK : error LNK1218: warning treated as error; no output file generated
echo Skip Binplace:
Skip Binplace:

Stop.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: dsingh@in.rainbow.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Why are you building a driver in kernel space and importing things

from
user-mode DLLs?
That generally doesn’t work.

The OP isn’t building a driver.

Chuck

----- Original Message -----
From: “Loren Wilton”
To: “Windows System Software Devs Interest List”
Sent: Thursday, December 09, 2004 1:17 PM
Subject: Re: [ntdev] Win 2003 DDK Build Query

>> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
>> C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
>> C:\WINDDK\3790\lib\wnet\i386\user32.lib
>> C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
>> C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
>> C:\WINDDK\3790\lib\wnet\i386\winspool.lib
>> C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
>> C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
>> C:\WINDDK\3790\lib\wnet\i386\shell32.lib
>> C:\WINDDK\3790\lib\wnet\i386\ole32.lib
>> C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
>> C:\WINDDK\3790\lib\wnet\i386\uuid.lib
>> C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
>> C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
>> C:\WINDDK\3790\lib\wnet\i386\psapi.lib
>> /Tmp
>> advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
>> specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
>> or /SUBSYSTEM:WINDOWS.
>> LINK : error LNK1218: warning treated as error; no output file
>> generated
>
> Why are you building a driver in kernel space and importing things
> from
> user-mode DLLs?
> That generally doesn’t work.

You must not use /SUBSYSTEM:NATIVE for an application. Instead use
/SUBSYSTEM:CONSOLE, /SUBSYSTEM:WINDOWS, etc. Note your linker command
line actually has two /SUBSYSTEM switches. Use only one.

Chuck

----- Original Message -----
From: “saurabh agrawal”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, December 08, 2004 6:28 PM
Subject: [ntdev] Win 2003 DDK Build Query

> NEWBIE IN THE OCEAN (12) DEPT
> Hi All,
> I am new to this list and am trying to build a 32 bit application on
> Windows 2003 using the Build utility provided in Windows 2003 DDK
> version 3790. My Application makes calls to a driver which I have
> successfully built using the Build utility. However when I try to
> compile and link my application I find this error:
>
> LINK : error LNK1218: warning treated as error; no output file
> generated
> BUILD: Done
> 10 files compiled
> 1 executable built - 1 Warning - 1 Error
>
> I have included the LINKER_FLAGS macro in my sources file yet am
> unable to override the default linking options.
> I would like to know :
> 1) If it is possible to suppress the linker warnings. I am assuming
> that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
> not suppressing linker warnings.
> 2) My application has to include “ntddk.h” for some definitions. Is
> this causing the linker to view my application as a device driver and
> tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
> defined in my application.
>
> As such I have posted a long mail but please do have a look at my
> sources file and the log file generated.
>
> P.S. This application used to compile and link perfectly on Windows
> 2000 in VC6.0 environment.
>
> Thanks and Regds,
> - Saurabh
>
> Sources File
> -----------------------------------------------------------
> TARGETNAME=Analyzer
> TARGETPATH=obj
> TARGETTYPE=PROGRAM
> MSC_OPTIMIZATION=/EHsc
> MSC_WARNING_LEVEL=/W0
>
>
> TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
> $(DDK_LIB_PATH)\user32.lib
> $(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
> $(DDK_LIB_PATH)\winspool.lib
> $(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
> $(DDK_LIB_PATH)\shell32.lib
> $(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib
> $(DDK_LIB_PATH)\uuid.lib
> $(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
> $(DDK_LIB_PATH)\psapi.lib
>
> SOURCES=MainApplication.cpp <br>> stdafx.cpp <br>> Analyzer.cpp <br>> argcargv.cpp <br>> Arguments.cpp <br>> Dynamic.cpp <br>> NtQuery.cpp <br>> Util.cpp <br>> analyzer.sys <br>> analyzer.rc
>
>
> INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include
>
> USE_INCREMENTAL_LINKING=1
> LINKER_FLAGS=/subsystem:console
>
> ----------------------------------------------------------------------------------------------------
>
> buildfre_wnet_x86.log
> --------------------------------
> BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
> analyzer.sys
> BUILD: Examining c:\analyzer\application directory for files to
> compile.
> Compiling c:\analyzer\application directory
> ‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
> rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
> -DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
> -DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”“
> -DSXS_TARGET=”““Analyzer.exe””“
> -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=”““Microsoft.Windows.SystemCompatible””“
> -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L”““Microsoft.Windows.SystemCompatible””"
> -z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
> objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
> -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
> -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
> -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D BUILDMACHINE =WinDDK -DFPO=1
> -DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
> -IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\crt .\analyzer.rc
> cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
> -IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
> -Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
> -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
> -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
> -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
> -D BUILDMACHINE =WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
> /Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
> -FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
> .\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
> .\dynamic.cpp .\ntquery.cpp .\util.cpp
> mainapplication.cpp
> stdafx.cpp
> analyzer.cpp
> argcargv.cpp
> arguments.cpp
> dynamic.cpp
> ntquery.cpp
> util.cpp
> Generating Code…
>
> Stop.
> Linking c:\analyzer\application directory

> ‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
> 386=1’
> link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
> @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
> Microsoft (R) Incremental Linker Version 7.10.2179
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> /subsystem:console
> -MERGE:_PAGE=PAGE
> -MERGE:_TEXT=.text
> -SECTION:INIT,d
> -OPT:NOREF
> -IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
> -NODEFAULTLIB
> /WX
> -debug:FULL
> -debugtype:cv
> -version:5.2
> -osversion:5.2
> /opt:nowin98
> -merge:.rdata=.text
> -STACK:0x40000,0x2000
> -subsystem:native,5.02
> -base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
> -entry:NtProcessStartup@4
> objfre_wnet_x86\i386\analyzer.res
> objfre_wnet_x86\i386\mainapplication.obj
> objfre_wnet_x86\i386\stdafx.obj
> objfre_wnet_x86\i386\analyzer.obj
> objfre_wnet_x86\i386\argcargv.obj
> objfre_wnet_x86\i386\arguments.obj
> objfre_wnet_x86\i386\dynamic.obj
> objfre_wnet_x86\i386\ntquery.obj
> objfre_wnet_x86\i386\util.obj
> C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\nt.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
> C:\WINDDK\3790\lib\wnet\i386\user32.lib
> C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
> C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
> C:\WINDDK\3790\lib\wnet\i386\winspool.lib
> C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
> C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
> C:\WINDDK\3790\lib\wnet\i386\shell32.lib
> C:\WINDDK\3790\lib\wnet\i386\ole32.lib
> C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
> C:\WINDDK\3790\lib\wnet\i386\uuid.lib
> C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
> C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
> C:\WINDDK\3790\lib\wnet\i386\psapi.lib
> /Tmp
> advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
> specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
> or /SUBSYSTEM:WINDOWS.
> LINK : error LNK1218: warning treated as error; no output file
> generated
> echo Skip Binplace:
> Skip Binplace:
>
> Stop.

TARGETTYPE=PROGRAM does this automatically.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Chuck Batson”
To: “Windows System Software Devs Interest List”
Sent: Thursday, December 09, 2004 1:37 PM
Subject: Re: [ntdev] Win 2003 DDK Build Query

> You must not use /SUBSYSTEM:NATIVE for an application. Instead use
> /SUBSYSTEM:CONSOLE, /SUBSYSTEM:WINDOWS, etc. Note your linker command
> line actually has two /SUBSYSTEM switches. Use only one.
>
> Chuck
>
> ----- Original Message -----
> From: “saurabh agrawal”
> To: “Windows System Software Devs Interest List”
> Sent: Wednesday, December 08, 2004 6:28 PM
> Subject: [ntdev] Win 2003 DDK Build Query
>
>
> > NEWBIE IN THE OCEAN (12) DEPT
> > Hi All,
> > I am new to this list and am trying to build a 32 bit application on
> > Windows 2003 using the Build utility provided in Windows 2003 DDK
> > version 3790. My Application makes calls to a driver which I have
> > successfully built using the Build utility. However when I try to
> > compile and link my application I find this error:
> >
> > LINK : error LNK1218: warning treated as error; no output file
> > generated
> > BUILD: Done
> > 10 files compiled
> > 1 executable built - 1 Warning - 1 Error
> >
> > I have included the LINKER_FLAGS macro in my sources file yet am
> > unable to override the default linking options.
> > I would like to know :
> > 1) If it is possible to suppress the linker warnings. I am assuming
> > that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
> > not suppressing linker warnings.
> > 2) My application has to include “ntddk.h” for some definitions. Is
> > this causing the linker to view my application as a device driver and
> > tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
> > defined in my application.
> >
> > As such I have posted a long mail but please do have a look at my
> > sources file and the log file generated.
> >
> > P.S. This application used to compile and link perfectly on Windows
> > 2000 in VC6.0 environment.
> >
> > Thanks and Regds,
> > - Saurabh
> >
> > Sources File
> > -----------------------------------------------------------
> > TARGETNAME=Analyzer
> > TARGETPATH=obj
> > TARGETTYPE=PROGRAM
> > MSC_OPTIMIZATION=/EHsc
> > MSC_WARNING_LEVEL=/W0
> >
> >
> > TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
> > $(DDK_LIB_PATH)\user32.lib
> > $(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
> > $(DDK_LIB_PATH)\winspool.lib
> > $(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
> > $(DDK_LIB_PATH)\shell32.lib
> > $(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib
> > $(DDK_LIB_PATH)\uuid.lib
> > $(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
> > $(DDK_LIB_PATH)\psapi.lib
> >
> > SOURCES=MainApplication.cpp <br>> > stdafx.cpp <br>> > Analyzer.cpp <br>> > argcargv.cpp <br>> > Arguments.cpp <br>> > Dynamic.cpp <br>> > NtQuery.cpp <br>> > Util.cpp <br>> > analyzer.sys <br>> > analyzer.rc
> >
> >
> > INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include
> >
> > USE_INCREMENTAL_LINKING=1
> > LINKER_FLAGS=/subsystem:console
> >
>
> -----------------------------------------------------------------------------
-----------------------
> >
> > buildfre_wnet_x86.log
> > --------------------------------
> > BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
> > analyzer.sys
> > BUILD: Examining c:\analyzer\application directory for files to
> > compile.
> > Compiling c:\analyzer\application directory
> > ‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
> > rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
> > -DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
> > -DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”“
> > -DSXS_TARGET=”““Analyzer.exe””“
> > -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=”““Microsoft.Windows.SystemCompatible””“
>
> -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L”““Microsoft.Windows.SystemCompatible””"
> > -z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
> > objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
> > -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
> > -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
> > -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D BUILDMACHINE =WinDDK -DFPO=1
> > -DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
> > -IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
> > -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
> > -IC:\WINDDK\3790\inc\crt .\analyzer.rc
> > cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
> > -IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
> > -Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
> > -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
> > -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
> > -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
> > -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
> > -D BUILDMACHINE =WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
> > /Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
> > -FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
> > .\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
> > .\dynamic.cpp .\ntquery.cpp .\util.cpp
> > mainapplication.cpp
> > stdafx.cpp
> > analyzer.cpp
> > argcargv.cpp
> > arguments.cpp
> > dynamic.cpp
> > ntquery.cpp
> > util.cpp
> > Generating Code…
> >
> > Stop.
> > Linking c:\analyzer\application directory

> > ‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
> > 386=1’
> > link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
> > @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
> > Microsoft (R) Incremental Linker Version 7.10.2179
> > Copyright (C) Microsoft Corporation. All rights reserved.
> >
> > /subsystem:console
> > -MERGE:_PAGE=PAGE
> > -MERGE:_TEXT=.text
> > -SECTION:INIT,d
> > -OPT:NOREF
> > -IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
> > -NODEFAULTLIB
> > /WX
> > -debug:FULL
> > -debugtype:cv
> > -version:5.2
> > -osversion:5.2
> > /opt:nowin98
> > -merge:.rdata=.text
> > -STACK:0x40000,0x2000
> > -subsystem:native,5.02
> > -base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
> > -entry:NtProcessStartup@4
> > objfre_wnet_x86\i386\analyzer.res
> > objfre_wnet_x86\i386\mainapplication.obj
> > objfre_wnet_x86\i386\stdafx.obj
> > objfre_wnet_x86\i386\analyzer.obj
> > objfre_wnet_x86\i386\argcargv.obj
> > objfre_wnet_x86\i386\arguments.obj
> > objfre_wnet_x86\i386\dynamic.obj
> > objfre_wnet_x86\i386\ntquery.obj
> > objfre_wnet_x86\i386\util.obj
> > C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
> > C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> > C:\WINDDK\3790\lib\wnet\i386\nt.lib
> > C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> > C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
> > C:\WINDDK\3790\lib\wnet\i386\user32.lib
> > C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
> > C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
> > C:\WINDDK\3790\lib\wnet\i386\winspool.lib
> > C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
> > C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
> > C:\WINDDK\3790\lib\wnet\i386\shell32.lib
> > C:\WINDDK\3790\lib\wnet\i386\ole32.lib
> > C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
> > C:\WINDDK\3790\lib\wnet\i386\uuid.lib
> > C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
> > C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
> > C:\WINDDK\3790\lib\wnet\i386\psapi.lib
> > /Tmp
> > advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
> > specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
> > or /SUBSYSTEM:WINDOWS.
> > LINK : error LNK1218: warning treated as error; no output file
> > generated
> > echo Skip Binplace:
> > Skip Binplace:
> >
> > Stop.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
analyzer.sys

That might be a problem?

Why are you listing a .sys file in your sources list?


Bill McKenzie
Software Engineer - Prism 802.11 Wireless Solutions
Conexant Systems, Inc.

“saurabh agrawal” wrote in message
news:xxxxx@ntdev…
> NEWBIE IN THE OCEAN (12) DEPT
> Hi All,
> I am new to this list and am trying to build a 32 bit application on
> Windows 2003 using the Build utility provided in Windows 2003 DDK
> version 3790. My Application makes calls to a driver which I have
> successfully built using the Build utility. However when I try to
> compile and link my application I find this error:
>
> LINK : error LNK1218: warning treated as error; no output file generated
> BUILD: Done
> 10 files compiled
> 1 executable built - 1 Warning - 1 Error
>
> I have included the LINKER_FLAGS macro in my sources file yet am
> unable to override the default linking options.
> I would like to know :
> 1) If it is possible to suppress the linker warnings. I am assuming
> that MSC_WARNING_LEVEL flags applies only to compiler warnings and is
> not suppressing linker warnings.
> 2) My application has to include “ntddk.h” for some definitions. Is
> this causing the linker to view my application as a device driver and
> tag it with /SUBSYSTEM:NATIVE flag. I do have a main() function
> defined in my application.
>
> As such I have posted a long mail but please do have a look at my
> sources file and the log file generated.
>
> P.S. This application used to compile and link perfectly on Windows
> 2000 in VC6.0 environment.
>
> Thanks and Regds,
> - Saurabh
>
> Sources File
> -----------------------------------------------------------
> TARGETNAME=Analyzer
> TARGETPATH=obj
> TARGETTYPE=PROGRAM
> MSC_OPTIMIZATION=/EHsc
> MSC_WARNING_LEVEL=/W0
>
>
> TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib $(DDK_LIB_PATH)\comctl32.lib
> $(DDK_LIB_PATH)\user32.lib
> $(DDK_LIB_PATH)\gdi32.lib $(DDK_LIB_PATH)\kernel32.lib
> $(DDK_LIB_PATH)\winspool.lib
> $(DDK_LIB_PATH)\comdlg32.lib $(DDK_LIB_PATH)\advapi32.lib
> $(DDK_LIB_PATH)\shell32.lib
> $(DDK_LIB_PATH)\ole32.lib $(DDK_LIB_PATH)\oleaut32.lib
> $(DDK_LIB_PATH)\uuid.lib
> $(DDK_LIB_PATH)\odbc32.lib $(DDK_LIB_PATH)\odbccp32.lib
> $(DDK_LIB_PATH)\psapi.lib
>
> SOURCES=MainApplication.cpp <br>> stdafx.cpp <br>> Analyzer.cpp <br>> argcargv.cpp <br>> Arguments.cpp <br>> Dynamic.cpp <br>> NtQuery.cpp <br>> Util.cpp <br>> analyzer.sys <br>> analyzer.rc
>
>
> INCLUDES=C:\WINDDK\3790\inc\ddk\w2k;C:\WINDDK\3790\inc\atl30;…\include
>
> USE_INCREMENTAL_LINKING=1
> LINKER_FLAGS=/subsystem:console
>
> ----------------------------------------------------------------------------------------------------
>
> buildfre_wnet_x86.log
> --------------------------------
> BUILD: c:\analyzer\application: Ignoring invalid SOURCES= entry:
> analyzer.sys
> BUILD: Examining c:\analyzer\application directory for files to compile.
> Compiling c:\analyzer\application directory
> ‘nmake.exe /c BUILDMSG=Stop. -i NTTEST= UMTEST= NOLINK=1 386=1’
> rc -l 409 -DSXS_ASSEMBLY_NAME=“”“”“”
> -DSXS_ASSEMBLY_VERSION=“”“”“” -DSXS_ASSEMBLY_LANGUAGE=“”“”“”
> -DSXS_PROCESSOR_ARCHITECTURE=“”“x86"”“
> -DSXS_TARGET=”““Analyzer.exe””“
> -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME=”““Microsoft.Windows.SystemCompatible””“
> -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L”““Microsoft.Windows.SystemCompatible””"
> -z “MS Sans Serif,Helv/MS Shell Dlg” -r -fo
> objfre_wnet_x86\i386\tdmfanalyzer.res -D_X86_=1 -Di386=1 -DSTD_CALL
> -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
> -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
> -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D BUILDMACHINE =WinDDK -DFPO=1
> -DNDEBUG -IC:\WINDDK\3790\inc\mfc42 -IC:\WINDDK\3790\inc\ddk\w2k
> -IC:\WINDDK\3790\inc\atl30 -I…\include -Iobjfre_wnet_x86\i386
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\crt .\analyzer.rc
> cl -nologo -Ii386\ -I. -IC:\WINDDK\3790\inc\mfc42
> -IC:\WINDDK\3790\inc\ddk\w2k -IC:\WINDDK\3790\inc\atl30 -I…\include
> -Iobjfre_wnet_x86\i386 -IC:\WINDDK\3790\inc\wnet
> -IC:\WINDDK\3790\inc\wnet -IC:\WINDDK\3790\inc\crt -D_X86_=1 -Di386=1
> -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100
> -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502
> -D_WIN32_IE=0x0600 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1
> -D BUILDMACHINE =WinDDK -DFPO=1 -DNDEBUG /c /Zel /Zp8 /Gy /Gi-
> /Gm- /W0 /WX /Gz /QIfdiv- /QIf /G6 /GX- /GR- /GF /GS -Z7 /EHsc /Oy
> -FIC:\WINDDK\3790\inc\wnet\warning.h .\mainapplication.cpp
> .\stdafx.cpp .\analyzer.cpp .\argcargv.cpp .\arguments.cpp
> .\dynamic.cpp .\ntquery.cpp .\util.cpp
> mainapplication.cpp
> stdafx.cpp
> analyzer.cpp
> argcargv.cpp
> arguments.cpp
> dynamic.cpp
> ntquery.cpp
> util.cpp
> Generating Code…
>
> Stop.
> Linking c:\analyzer\application directory

> ‘nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
> 386=1’
> link -out:objfre_wnet_x86\i386\Analyzer.exe -machine:ix86
> @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmA.tmp
> Microsoft (R) Incremental Linker Version 7.10.2179
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> /subsystem:console
> -MERGE:_PAGE=PAGE
> -MERGE:_TEXT=.text
> -SECTION:INIT,d
> -OPT:NOREF
> -IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
> -NODEFAULTLIB
> /WX
> -debug:FULL
> -debugtype:cv
> -version:5.2
> -osversion:5.2
> /opt:nowin98
> -merge:.rdata=.text
> -STACK:0x40000,0x2000
> -subsystem:native,5.02
> -base:@C:\WINDDK\3790\bin\coffbase.txt,usermode
> -entry:NtProcessStartup@4
> objfre_wnet_x86\i386\analyzer.res
> objfre_wnet_x86\i386\mainapplication.obj
> objfre_wnet_x86\i386\stdafx.obj
> objfre_wnet_x86\i386\analyzer.obj
> objfre_wnet_x86\i386\argcargv.obj
> objfre_wnet_x86\i386\arguments.obj
> objfre_wnet_x86\i386\dynamic.obj
> objfre_wnet_x86\i386\ntquery.obj
> objfre_wnet_x86\i386\util.obj
> C:\WINDDK\3790\lib\wnet\i386\BufferOverflow.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\nt.lib
> C:\WINDDK\3790\lib\wnet\i386\ntdll.lib
> C:\WINDDK\3790\lib\wnet\i386\comctl32.lib
> C:\WINDDK\3790\lib\wnet\i386\user32.lib
> C:\WINDDK\3790\lib\wnet\i386\gdi32.lib
> C:\WINDDK\3790\lib\wnet\i386\kernel32.lib
> C:\WINDDK\3790\lib\wnet\i386\winspool.lib
> C:\WINDDK\3790\lib\wnet\i386\comdlg32.lib
> C:\WINDDK\3790\lib\wnet\i386\advapi32.lib
> C:\WINDDK\3790\lib\wnet\i386\shell32.lib
> C:\WINDDK\3790\lib\wnet\i386\ole32.lib
> C:\WINDDK\3790\lib\wnet\i386\oleaut32.lib
> C:\WINDDK\3790\lib\wnet\i386\uuid.lib
> C:\WINDDK\3790\lib\wnet\i386\odbc32.lib
> C:\WINDDK\3790\lib\wnet\i386\odbccp32.lib
> C:\WINDDK\3790\lib\wnet\i386\psapi.lib
> /Tmp
> advapi32.lib(ADVAPI32.dll) : warning LNK4237: /SUBSYSTEM:NATIVE
> specified when importing from ‘ADVAPI32.DLL’; Use /SUBSYSTEM:CONSOLE
> or /SUBSYSTEM:WINDOWS.
> LINK : error LNK1218: warning treated as error; no output file generated
> echo Skip Binplace:
> Skip Binplace:
>
> Stop.
>