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 :
- 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. - 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.