Linker Error With MFC

I am trying to use a library (compiled by me) compiled using VS2K5, as a
static lib, uses MFC as a shared DLL, doesn’t use ATL, unicode compilant, no
common language runtime support, uses precompiled headers.

Now in my project, which happens to be a rendering plugin for the printer
(the bitmap sample’s modificaton), I try to use this lib. The sources file
look like…

To build version with debug output, add -D_DEBUG to C_DEFINES line below

C_DEFINES=$(C_DEFINES) -DKERNEL_MODE -D_UNICODE -DUNICODE -DOEMCOM
-DUSERMODE_DRIVER

INCLUDES=…;$(SDK_INC_PATH)\MFC42

SOURCES= dllentry.cpp \
enable.cpp \
intrface.cpp \
ddihook.cpp \
debug.cpp \
devmode.cpp \
bitmap.rc

TARGETLIBS= $(TARGETLIBS) \
$(SDK_LIB_PATH)\uuid.lib \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\winspool.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\gdi32.lib \
$(DDK_LIB_PATH)\umpdddi.lib \
$(SDK_LIB_PATH)\ole32.lib \
$(SDK_LIB_PATH)\advapi32.lib \
*$(SDK_LIB_PATH)\cximage.lib *

check the last line, it has the new library added to it.

I get the linker error, DONT know how to build cximage.lib.

D:\PRNMON\RENPLUGIN>bld
BUILD: Adding /Y to COPYCMD so xcopy ops won’t hang.
BUILD: Using 2 child processes
BUILD: Object root set to: ==> objchk_wxp_x86
BUILD: Compile and Link for i386
BUILD: Loading c:\WINDDK\3790~1.183\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Examining d:\prnmon\renplugin directory for files to compile.
d:\prnmon\renplugin - 8 source files (5,032 lines)
BUILD: Saving c:\WINDDK\3790~1.183\build.dat…
BUILD: Compiling (NoSync) d:\prnmon\renplugin directory
1>Precompiling - precomp.h for i386
1>Compiling - bitmap.rc for i386
1>Compiling - dllentry.cpp for i386
1>Compiling - enable.cpp for i386
1>Compiling - intrface.cpp for i386
1>Compiling - ddihook.cpp for i386
1>Compiling - debug.cpp for i386
1>Compiling - devmode.cpp for i386
1>Compiling - generating code… for i386
BUILD: Compiling d:\prnmon\renplugin directory
100>Building Library - d:\prnmon\i386\bitmap.lib for i386
BUILD: Linking d:\prnmon\renplugin directory
1>errors in directory d:\prnmon\renplugin
1>NMAKE : fatal error U1073: don’t know how to make
‘c:\WINDDK\3790~1.183\lib\wx
p\i386\cximage.lib’
BUILD: nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST=
UMTEST=
MAKEDLL=1 386=1 failed - rc = 2
BUILD: Done

9 files compiled - 1 Error - 1006 LPS
1 library built

D:\PRNMON\RENPLUGIN>

I cant understand how this is to be solved!!! I have already built the
library (compiled and linked) before I use this DDK build. Still what is the
problem?

amitr0

  • amitr0

Your lib is not detected as valid ( or incompatible ). You should compile your lib sources and build your lib with the same versions that
the DDK 3790 uses. If I remember correctly this is VC71 , thus using VS2003 instead of VS2005.
Christiaan

----- Original Message -----
From: amitr0
To: Windows System Software Devs Interest List
Cc: Bob Kjelgaard
Sent: Monday, November 06, 2006 8:27 AM
Subject: [ntdev] Linker Error With MFC

I am trying to use a library (compiled by me) compiled using VS2K5, as a static lib, uses MFC as a shared DLL, doesn’t use ATL, unicode compilant, no common language runtime support, uses precompiled headers.

Now in my project, which happens to be a rendering plugin for the printer (the bitmap sample’s modificaton), I try to use this lib. The sources file look like…

To build version with debug output, add -D_DEBUG to C_DEFINES line below

C_DEFINES=$(C_DEFINES) -DKERNEL_MODE -D_UNICODE -DUNICODE -DOEMCOM -DUSERMODE_DRIVER

INCLUDES=…;$(SDK_INC_PATH)\MFC42

SOURCES= dllentry.cpp \
enable.cpp \
intrface.cpp \
ddihook.cpp \
debug.cpp \
devmode.cpp \
bitmap.rc

TARGETLIBS= $(TARGETLIBS) \
$(SDK_LIB_PATH)\uuid.lib \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\winspool.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\gdi32.lib \
$(DDK_LIB_PATH)\umpdddi.lib \
$(SDK_LIB_PATH)\ole32.lib \
$(SDK_LIB_PATH)\advapi32.lib \
$(SDK_LIB_PATH)\cximage.lib \

check the last line, it has the new library added to it.

I get the linker error, DONT know how to build cximage.lib.

D:\PRNMON\RENPLUGIN>bld
BUILD: Adding /Y to COPYCMD so xcopy ops won’t hang.
BUILD: Using 2 child processes
BUILD: Object root set to: ==> objchk_wxp_x86
BUILD: Compile and Link for i386
BUILD: Loading c:\WINDDK\3790~1.183\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Examining d:\prnmon\renplugin directory for files to compile.
d:\prnmon\renplugin - 8 source files (5,032 lines)
BUILD: Saving c:\WINDDK\3790~1.183\build.dat…
BUILD: Compiling (NoSync) d:\prnmon\renplugin directory
1>Precompiling - precomp.h for i386
1>Compiling - bitmap.rc for i386
1>Compiling - dllentry.cpp for i386
1>Compiling - enable.cpp for i386
1>Compiling - intrface.cpp for i386
1>Compiling - ddihook.cpp for i386
1>Compiling - debug.cpp for i386
1>Compiling - devmode.cpp for i386
1>Compiling - generating code… for i386
BUILD: Compiling d:\prnmon\renplugin directory
100>Building Library - d:\prnmon\i386\bitmap.lib for i386
BUILD: Linking d:\prnmon\renplugin directory
1>errors in directory d:\prnmon\renplugin
1>NMAKE : fatal error U1073: don’t know how to make ‘c:\WINDDK\3790~1.183\lib\wx
p\i386\cximage.lib’
BUILD: nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
MAKEDLL=1 386=1 failed - rc = 2
BUILD: Done

9 files compiled - 1 Error - 1006 LPS
1 library built

D:\PRNMON\RENPLUGIN>

I cant understand how this is to be solved!!! I have already built the library (compiled and linked) before I use this DDK build. Still what is the problem?

amitr0

but…I dont have that version here at my office! How else can I do it?

On 11/6/06, Christiaan Ghijselinck
wrote:
>
>
> Your lib is not detected as valid ( or incompatible ). You should compile
> your lib sources and build your lib with the same versions that
> the DDK 3790 uses. If I remember correctly this is VC71 , thus using
> VS2003 instead of VS2005.
> Christiaan
>
>
> ----- Original Message -----
> From: amitr0
> To: Windows System Software Devs Interest List
> Cc: Bob Kjelgaard
> Sent: Monday, November 06, 2006 8:27 AM
> Subject: [ntdev] Linker Error With MFC
>
>
> I am trying to use a library (compiled by me) compiled using VS2K5, as a
> static lib, uses MFC as a shared DLL, doesn’t use ATL, unicode compilant, no
> common language runtime support, uses precompiled headers.
>
> Now in my project, which happens to be a rendering plugin for the printer
> (the bitmap sample’s modificaton), I try to use this lib. The sources file
> look like…
>
>
> # To build version with debug output, add -D_DEBUG to C_DEFINES line below
> C_DEFINES=$(C_DEFINES) -DKERNEL_MODE -D_UNICODE -DUNICODE -DOEMCOM
> -DUSERMODE_DRIVER
>
> INCLUDES=…;$(SDK_INC_PATH)\MFC42
>
> SOURCES= dllentry.cpp <br>> enable.cpp <br>> intrface.cpp <br>> ddihook.cpp <br>> debug.cpp <br>> devmode.cpp <br>> bitmap.rc
>
> TARGETLIBS= $(TARGETLIBS) <br>> $(SDK_LIB_PATH)\uuid.lib <br>> $(SDK_LIB_PATH)\kernel32.lib <br>> $(SDK_LIB_PATH)\winspool.lib <br>> $(SDK_LIB_PATH)\user32.lib <br>> $(SDK_LIB_PATH)\gdi32.lib <br>> $(DDK_LIB_PATH)\umpdddi.lib <br>> $(SDK_LIB_PATH)\ole32.lib <br>> $(SDK_LIB_PATH)\advapi32.lib <br>> *$(SDK_LIB_PATH)\cximage.lib \ *
>
>
>
> check the last line, it has the new library added to it.
>
> I get the linker error, DONT know how to build cximage.lib.
>
>
>
> D:\PRNMON\RENPLUGIN>bld
> BUILD: Adding /Y to COPYCMD so xcopy ops won’t hang.
> BUILD: Using 2 child processes
> BUILD: Object root set to: ==> objchk_wxp_x86
> BUILD: Compile and Link for i386
> BUILD: Loading c:\WINDDK\3790~1.183\build.dat…
> BUILD: Computing Include file dependencies:
> BUILD: Examining d:\prnmon\renplugin directory for files to compile.
> d:\prnmon\renplugin - 8 source files (5,032 lines)
> BUILD: Saving c:\WINDDK\3790~1.183\build.dat…
> BUILD: Compiling (NoSync) d:\prnmon\renplugin directory
> 1>Precompiling - precomp.h for i386
> 1>Compiling - bitmap.rc for i386
> 1>Compiling - dllentry.cpp for i386
> 1>Compiling - enable.cpp for i386
> 1>Compiling - intrface.cpp for i386
> 1>Compiling - ddihook.cpp for i386
> 1>Compiling - debug.cpp for i386
> 1>Compiling - devmode.cpp for i386
> 1>Compiling - generating code… for i386
> BUILD: Compiling d:\prnmon\renplugin directory
> 100>Building Library - d:\prnmon\i386\bitmap.lib for i386
> BUILD: Linking d:\prnmon\renplugin directory
> 1>errors in directory d:\prnmon\renplugin
> 1>NMAKE : fatal error U1073: don’t know how to make
> ‘c:\WINDDK\3790~1.183\lib\wx
> p\i386\cximage.lib’
> BUILD: nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST=
> UMTEST=
> MAKEDLL=1 386=1 failed - rc = 2
> BUILD: Done
>
> 9 files compiled - 1 Error - 1006 LPS
> 1 library built
>
> D:\PRNMON\RENPLUGIN>
>
>
>
>
>
>
>
> I cant understand how this is to be solved!!! I have already built the
> library (compiled and linked) before I use this DDK build. Still what is the
> problem?
>
>
>
> amitr0
>
>
>
> –
>
> - amitr0
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>



- amitr0

You can try to build your lib using the DDK compiler , with the MFC42 libs that the DDK provides.

Christiaan

but…I dont have that version here at my office! How else can I do it?

On 11/6/06, Christiaan Ghijselinck wrote:

Your lib is not detected as valid ( or incompatible ). You should compile your lib sources and build your lib with the same versions that
the DDK 3790 uses. If I remember correctly this is VC71 , thus using VS2003 instead of VS2005.
Christiaan

----- Original Message -----
From: amitr0
To: Windows System Software Devs Interest List
Cc: Bob Kjelgaard
Sent: Monday, November 06, 2006 8:27 AM
Subject: [ntdev] Linker Error With MFC

I am trying to use a library (compiled by me) compiled using VS2K5, as a static lib, uses MFC as a shared DLL, doesn’t use ATL, unicode compilant, no common language runtime support, uses precompiled headers.

Now in my project, which happens to be a rendering plugin for the printer (the bitmap sample’s modificaton), I try to use this lib. The sources file look like…

# To build version with debug output, add -D_DEBUG to C_DEFINES line below
C_DEFINES=$(C_DEFINES) -DKERNEL_MODE -D_UNICODE -DUNICODE -DOEMCOM -DUSERMODE_DRIVER

INCLUDES=…;$(SDK_INC_PATH)\MFC42

SOURCES= dllentry.cpp <br> enable.cpp <br> intrface.cpp <br> ddihook.cpp <br> debug.cpp <br> devmode.cpp <br> bitmap.rc

TARGETLIBS= $(TARGETLIBS) <br> $(SDK_LIB_PATH)\uuid.lib <br> $(SDK_LIB_PATH)\kernel32.lib <br> $(SDK_LIB_PATH)\winspool.lib <br> $(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\gdi32.lib <br> $(DDK_LIB_PATH)\umpdddi.lib <br> $(SDK_LIB_PATH)\ole32.lib <br> $(SDK_LIB_PATH)\advapi32.lib <br> $(SDK_LIB_PATH)\cximage.lib \

check the last line, it has the new library added to it.

I get the linker error, DONT know how to build cximage.lib.

D:\PRNMON\RENPLUGIN>bld
BUILD: Adding /Y to COPYCMD so xcopy ops won’t hang.
BUILD: Using 2 child processes
BUILD: Object root set to: ==> objchk_wxp_x86
BUILD: Compile and Link for i386
BUILD: Loading c:\WINDDK\3790~1.183\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Examining d:\prnmon\renplugin directory for files to compile.
d:\prnmon\renplugin - 8 source files (5,032 lines)
BUILD: Saving c:\WINDDK\3790~1.183\build.dat…
BUILD: Compiling (NoSync) d:\prnmon\renplugin directory
1>Precompiling - precomp.h for i386
1>Compiling - bitmap.rc for i386
1>Compiling - dllentry.cpp for i386
1>Compiling - enable.cpp for i386
1>Compiling - intrface.cpp for i386
1>Compiling - ddihook.cpp for i386
1>Compiling - debug.cpp for i386
1>Compiling - devmode.cpp for i386
1>Compiling - generating code… for i386
BUILD: Compiling d:\prnmon\renplugin directory
100>Building Library - d:\prnmon\i386\bitmap.lib for i386
BUILD: Linking d:\prnmon\renplugin directory
1>errors in directory d:\prnmon\renplugin
1>NMAKE : fatal error U1073: don’t know how to make ‘c:\WINDDK\3790~1.183\lib\wx
p\i386\cximage.lib’
BUILD: nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
MAKEDLL=1 386=1 failed - rc = 2
BUILD: Done

9 files compiled - 1 Error - 1006 LPS
1 library built

D:\PRNMON\RENPLUGIN>

I cant understand how this is to be solved!!! I have already built the library (compiled and linked) before I use this DDK build. Still what is the problem?

amitr0



- amitr0
— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


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

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer



- amitr0 — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

The message means that cximage.lib was not found- SDK_LIB_PATH’s exact meaning can vary depending upon the build environment (ie, there are platform architecture variants and can also be target OS-dependent variants), so I won’t give a precise answer as to what it actually resolves to. It’s usually easiest to just read the build log to see what it is in any particular case.

I’d recommend that you not use that macro at all- Microsoft owns its meaning and I wouldn’t [putting on my outsider’s hat for a moment] blithely assume it won’t move to some other tree on some future kit release [since the new kit could just reorganize its library tree and change the macro definition to suit that].

Place the library at some convenient point for your own build processes and either code a direct path to it or use an NMAKE macro of your own to point to it. There is absolutely no rule that a lib has to be in the DDK paths for you to be able to use it. One easy way is to just put the library in the same tree as your driver and use a relative path to it.

BTW, this isn’t a message from build- it’s from NMAKE and VS2K5 itself would give you approximately the same feedback if you make the same error there. You said you needed a binary at a particular location, it isn’t there, and it has no instructions for building it.

Dear Bob,

Well, I tried that, I copied the library to C:\ and set the path in sources
to the same.

Well now I get the following in the build logs.

Linking e:\downloads\prnmon\renplugin directory ********************
1>‘nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST=
MAKEDLL=1 386=1’
1>BUILDMSG: Processing e:\downloads\prnmon\renplugin
1> link -out:…\i386\bitmap.dll -machine:ix86
@C:\DOCUME~1\AMITRA~1.BAN\LOCALS~1\Temp\nm137.tmp
1>Microsoft (R) Incremental Linker Version 7.10.4035
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>-MERGE:_PAGE=PAGE
1>-MERGE:_TEXT=.text
1>-SECTION:INIT,d
1>-OPT:REF
1>-OPT:ICF
1>-IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
1>-INCREMENTAL:NO
1>-FULLBUILD
1>/release
1>-NODEFAULTLIB
1>/WX
1>-debug
1>-debugtype:cv
1>-version:5.1
1>-osversion:5.1
1>/functionpadmin:5
1>/safeseh
1>/opt:nowin98
1>-merge:.rdata=.text
1>/pdbcompress
1>-STACK:0x40000,0x1000
1>-dll
1>-base:0x70000000
1>-subsystem:console,4.10
1>-entry:_DllMainCRTStartup@12
1>objchk_wxp_x86\i386\precomp.obj
1>…\i386\bitmap.exp
1>objchk_wxp_x86\i386\bitmap.res
1>objchk_wxp_x86\i386\dllentry.obj
1>objchk_wxp_x86\i386\enable.obj
1>objchk_wxp_x86\i386\intrface.obj
1>objchk_wxp_x86\i386\ddihook.obj
1>objchk_wxp_x86\i386\debug.obj
1>objchk_wxp_x86\i386\devmode.obj
1>E:\WINDDK\3790~1.183\lib\wxp\i386\BufferOverflowU.lib
1>E:\WINDDK\3790~1.183\lib\crt\i386\msvcrt.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\ntdll.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\uuid.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\kernel32.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\winspool.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\user32.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\gdi32.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\umpdddi.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\ole32.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\advapi32.lib
1>C:\cximage.lib
1>E:\WINDDK\3790~1.183\lib\wxp\i386\sehupd.lib
1>cximage.lib(ximainfo.obj) : warning LNK4229: invalid directive
‘/manifestdependency:type=‘win32’ name=‘Microsoft.VC80.DebugCRT’ version=’
8.0.50608.0’ processorArchitecture=‘x86’ publicKeyToken=‘1fc8b3b9a1e18e3b’’
encountered; ignored
1>LINK : error LNK1218: warning treated as error; no output file generated
1> echo Skip Binplace:
1>Skip Binplace:
1>
1>Stop.
\

How do I get rid of this Manifest error?
Seeteh environemt is like, the Cximage lib is built from the VS2005 IDE and
the lib file is used for static linking with the DDK bitmap rendering
plugin.

Googling didn’t help, ofcourse it doesnt mean that the information is not
there, but probably that I ddin’t use the right search strings!!!

amitr0

On 11/6/06, Bob Kjelgaard wrote:
>
> The message means that cximage.lib was not found- SDK_LIB_PATH’s exact
> meaning can vary depending upon the build environment (ie, there are
> platform architecture variants and can also be target OS-dependent
> variants), so I won’t give a precise answer as to what it actually resolves
> to. It’s usually easiest to just read the build log to see what it is in
> any particular case.
>
> I’d recommend that you not use that macro at all- Microsoft owns its
> meaning and I wouldn’t [putting on my outsider’s hat for a moment] blithely
> assume it won’t move to some other tree on some future kit release [since
> the new kit could just reorganize its library tree and change the macro
> definition to suit that].
>
> Place the library at some convenient point for your own build processes
> and either code a direct path to it or use an NMAKE macro of your own to
> point to it. There is absolutely no rule that a lib has to be in the DDK
> paths for you to be able to use it. One easy way is to just put the library
> in the same tree as your driver and use a relative path to it.
>
> BTW, this isn’t a message from build- it’s from NMAKE and VS2K5 itself
> would give you approximately the same feedback if you make the same error
> there. You said you needed a binary at a particular location, it isn’t
> there, and it has no instructions for building it.
>



- amitr0

It would be easiest to follow the sage advice Christiaan gave you earlier, so I’ll suggest the same thing in different terms:

Take your source files for this library, create a SOURCES file for them, and build the library with the same DDK version you use for the driver. This is by far the easiest thing to do- there is lots of information available online, and a lot of people know how to do this who might be willing to help.

If you must use inconsistent tools, you’re probably not going to find a lot of help anywhere. I’ve never seriously tried what you are doing- considered it, but couldn’t justify all the time it would take me to figure it out, so all I have are two guesses:

You can try to set the manifest file options in the project properties for this library to NOT embed a manifest. That might suppress the linker comment in your lib file, which produced this failure. But if this is supposed to be a static library, and not an import library from a DLL you built with VS2005, I doubt that option even exists .

You MIGHT be able to build this as you are now attempting to build it with the WDK (it has a newer linker which recognizes and supports this switch, but that doesn’t mean it’s the only thing wrong with this configuration).

The presence of that dependency suggests that you’ve got a side-by-side runtime library in use in your cximage.lib, whether you realize it or not. I’m not certain that’s really what you want to have in a printer driver- at the very least, it could complicate installation. Win2K doesn’t support app isolation and side-by-side assemblies at all (although maybe you can add .Net framework to the list of things you install there- that’s again outside my experience).

Really, life is almost certainly going to be easier for you if you build all of the pieces of your driver with the DDK tools, including BUILD.

amitr0 wrote:

> 1>cximage.lib(ximainfo.obj) : warning LNK4229: invalid directive
> ‘/manifestdependency:type=‘win32’ name=‘Microsoft.VC80.DebugCRT’ version=’
> 8.0.50608.0’ processorArchitecture=‘x86’ publicKeyToken=‘1fc8b3b9a1e18e3b’'
> encountered; ignored

I do not have better advice than already provided. I just wanted to
confirm that seeing this suggests to me that although cximage.lib
itself may be a static library, cximage.lib (or at least ximainfo.obj)
was compiled with switches that insinuate use the CRT as a shared
library.

i.e. You have a static library of code, and that static library code
uses (or is compiled to use) the CRT as a shared DLL.

Seeing that the “/manifestdependency” line was emitted into the .OBJ
would make me suspicious as to the preprocessor defines that are
present when ximainfo.obj or the project as a whole complies.

e.g. That _DLL is being directly or indirectly defined, which makes
CRTDEFS.H decide that an appropriate manifest dependency needs to be
generated. Note it’s not a matter of “suppressing the manifest file”;
this warning is talking about a directive in the ximainfo.obj, and not
in a manifest (yet).

The idea that the CRTDEFS.H header (and MFCASSEM.H header, in the case
of MFC 8.x) caused LINK.EXE command line switches to be embedded in
the .OBJ was puzzling until I finally realized what information was
causing these linker directives to materialize.

e.g. Unlike other cases where you would expect there needed to be a
.LIB on your LINK.EXE command line in order for the library to have
been attempted, the CRT 8.x and MFC (even 4.x) headers control from
the header files how some of the linker directives will get specified.

Alan Adams

Oops, passed over the notation indicating the error message originated from an obj file in a static lib- thanks for pointing that out, Alan.

So, I’m sure none of my suggestions [other than the only sane one, which is to go with the flow and use the DDK like everyone else has to] will get you anywhere. While finding a way to say you want a static CRT in your library project might suppress the comment pragma, I’d still expect trouble, since the rest of the DDK-built code expects to link with an earlier version of the shared CRT.

amitr0 wrote:

Well, I tried that, I copied the library to C:\ and set the path in
sources to the same.

Well now I get the following in the build logs.

Linking e:\downloads\prnmon\renplugin directory ********************
1>‘nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST=
UMTEST= MAKEDLL=1 386=1’
1>BUILDMSG: Processing e:\downloads\prnmon\renplugin
1> link -out:…\i386\bitmap.dll -machine:ix86
@C:\DOCUME~1\AMITRA~1.BAN\LOCALS~1\Temp\nm137.tmp
1>Microsoft (R) Incremental Linker Version 7.10.4035
1>Copyright (C) Microsoft Corporation. All rights reserved.

This says you are using the Visual Studio 2003 linker, not VS2005.
Manifests are a VS2005 invention. What DDK are you using?

How do I get rid of this Manifest error?
Seeteh environemt is like, the Cximage lib is built from the VS2005
IDE and the lib file is used for static linking with the DDK bitmap
rendering plugin.

You either need to build your cximage.lib without the manifest stuff, or
build your driver with the newer compiler. The WDK includes VS2005.


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

What I find that works is to go the other way: link your VS apps with ddk
built libs.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Christiaan
Ghijselinck
Sent: Monday, November 06, 2006 3:04 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Linker Error With MFC

Your lib is not detected as valid ( or incompatible ). You should compile
your lib sources and build your lib with the same versions that
the DDK 3790 uses. If I remember correctly this is VC71 , thus using VS2003
instead of VS2005.
Christiaan

----- Original Message -----
From: amitr0 mailto:xxxxx
To: Windows System Software Devs Interest mailto:xxxxx List

Cc: Bob Kjelgaard mailto:xxxxx
Sent: Monday, November 06, 2006 8:27 AM
Subject: [ntdev] Linker Error With MFC

I am trying to use a library (compiled by me) compiled using VS2K5, as a
static lib, uses MFC as a shared DLL, doesn’t use ATL, unicode compilant, no
common language runtime support, uses precompiled headers.

Now in my project, which happens to be a rendering plugin for the printer
(the bitmap sample’s modificaton), I try to use this lib. The sources file
look like…

# To build version with debug output, add -D_DEBUG to C_DEFINES line below
C_DEFINES=$(C_DEFINES) -DKERNEL_MODE -D_UNICODE -DUNICODE -DOEMCOM
-DUSERMODE_DRIVER

INCLUDES=…;$(SDK_INC_PATH)\MFC42

SOURCES= dllentry.cpp <br> enable.cpp <br> intrface.cpp <br> ddihook.cpp <br> debug.cpp <br> devmode.cpp <br> bitmap.rc

TARGETLIBS= $(TARGETLIBS) <br> $(SDK_LIB_PATH)\uuid.lib <br> $(SDK_LIB_PATH)\kernel32.lib <br> $(SDK_LIB_PATH)\winspool.lib <br> $(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\gdi32.lib <br> $(DDK_LIB_PATH)\umpdddi.lib <br> $(SDK_LIB_PATH)\ole32.lib <br> $(SDK_LIB_PATH)\advapi32.lib <br> $(SDK_LIB_PATH)\cximage.lib \

check the last line, it has the new library added to it.

I get the linker error, DONT know how to build cximage.lib.

D:\PRNMON\RENPLUGIN>bld
BUILD: Adding /Y to COPYCMD so xcopy ops won’t hang.
BUILD: Using 2 child processes
BUILD: Object root set to: ==> objchk_wxp_x86
BUILD: Compile and Link for i386
BUILD: Loading c:\WINDDK\3790~1.183\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Examining d:\prnmon\renplugin directory for files to compile.
d:\prnmon\renplugin - 8 source files (5,032 lines)
BUILD: Saving c:\WINDDK\3790~1.183\build.dat…
BUILD: Compiling (NoSync) d:\prnmon\renplugin directory
1>Precompiling - precomp.h for i386
1>Compiling - bitmap.rc for i386
1>Compiling - dllentry.cpp for i386
1>Compiling - enable.cpp for i386
1>Compiling - intrface.cpp for i386
1>Compiling - ddihook.cpp for i386
1>Compiling - debug.cpp for i386
1>Compiling - devmode.cpp for i386
1>Compiling - generating code… for i386
BUILD: Compiling d:\prnmon\renplugin directory
100>Building Library - d:\prnmon\i386\bitmap.lib for i386
BUILD: Linking d:\prnmon\renplugin directory
1>errors in directory d:\prnmon\renplugin
1>NMAKE : fatal error U1073: don’t know how to make
‘c:\WINDDK\3790~1.183\lib\wx
p\i386\cximage.lib’
BUILD: nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST=
UMTEST=
MAKEDLL=1 386=1 failed - rc = 2
BUILD: Done

9 files compiled - 1 Error - 1006 LPS
1 library built

D:\PRNMON\RENPLUGIN>

I cant understand how this is to be solved!!! I have already built the
library (compiled and linked) before I use this DDK build. Still what is the
problem?

amitr0



- amitr0
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>