LNK2005 error while building Kernel.

Hello All,

I am working on WinCE Device Drivers.

While building the kernel I am getting the following
error.
nk.lib(printf.obj) : error LNK2005: NKDbgPrintfW
already defined in hal.lib(COREDLL.dll)

I did some trials as below.

  1. I used the linker option /FORCE:MULTIPLE
    The Error went away, howaever thrown a warning
    saying that Image may not boot up and it really did
    not.
  2. I set the libraris nk.lib and coredll.lib in
    TARGETLIBS in the correct order in the sources of
    Kernel and the error went away.
    However still image doesn’t boots up.
  3. then I included the coredll.lib as TARGETLIBS as
    part of hal.lib sources.
    However some functions of coredll.lib like
    InterruptInitialize are unresolved externel symbol
    while building Kernel.
    To generate kern.exe
    TARGETLIBS=nk.lib \
    hal.lib \
    fulllibc.lib \
    loadauth.lib \
    To generate hal.lib
    I have used the TARGETLIBS=coredll.lib
    then the above mentioned 3rd point came.

Can u tell me how to resolve this error.

Thanks n Regards.
Sachin Nikam.

Send instant messages to your online friends http://in.messenger.yahoo.com

This is not a group for CE.

“Sachin Nikam.” wrote in message news:xxxxx@ntdev…
> Hello All,
>
> I am working on WinCE Device Drivers.
>
> While building the kernel I am getting the following
> error.
> nk.lib(printf.obj) : error LNK2005: NKDbgPrintfW
> already defined in hal.lib(COREDLL.dll)
>
> I did some trials as below.
> 1. I used the linker option /FORCE:MULTIPLE
> The Error went away, howaever thrown a warning
> saying that Image may not boot up and it really did
> not.
> 2. I set the libraris nk.lib and coredll.lib in
> TARGETLIBS in the correct order in the sources of
> Kernel and the error went away.
> However still image doesn’t boots up.
> 3. then I included the coredll.lib as TARGETLIBS as
> part of hal.lib sources.
> However some functions of coredll.lib like
> InterruptInitialize are unresolved externel symbol
> while building Kernel.
> To generate kern.exe
> TARGETLIBS=nk.lib <br>> hal.lib <br>> fulllibc.lib <br>> loadauth.lib <br>> To generate hal.lib
> I have used the TARGETLIBS=coredll.lib
> then the above mentioned 3rd point came.
>
> Can u tell me how to resolve this error.
>
>
> Thanks n Regards.
> Sachin Nikam.
>
> Send instant messages to your online friends http://in.messenger.yahoo.com
>
>

Sachin Nikam. wrote:

Hello All,

I am working on WinCE Device Drivers.

While building the kernel I am getting the following
error.
nk.lib(printf.obj) : error LNK2005: NKDbgPrintfW
already defined in hal.lib(COREDLL.dll)

I did some trials as below.

  1. I used the linker option /FORCE:MULTIPLE
    The Error went away, howaever thrown a warning
    saying that Image may not boot up and it really did
    not.
  2. I set the libraris nk.lib and coredll.lib in
    TARGETLIBS in the correct order in the sources of
    Kernel and the error went away.
    However still image doesn’t boots up.
  3. then I included the coredll.lib as TARGETLIBS as
    part of hal.lib sources.
    However some functions of coredll.lib like
    InterruptInitialize are unresolved externel symbol
    while building Kernel.
    To generate kern.exe
    TARGETLIBS=nk.lib \
    hal.lib \
    fulllibc.lib \
    loadauth.lib \
    To generate hal.lib
    I have used the TARGETLIBS=coredll.lib
    then the above mentioned 3rd point came.

Can u tell me how to resolve this error.

Have you EVER been able to build a working image from your source base?
That is, are you working on the initial bring-up, or are you modifying
something which was known to work previously on your hardware? Are you
sure your boot loader is OK?

Initial bring-up is perhaps the nastiest part of CE programming. You
end up having to use other low-level tools to make sure that the bytes
are actually getting to memory, in their expected locations, with the
proper relocation.


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

Hello All,

I am working on Windows Device Drivers.

While building the kernel I am getting the following
error.
nk.lib(printf.obj) : error LNK2005: NKDbgPrintfW
already defined in hal.lib(COREDLL.dll)

I did some trials as below.

  1. I used the linker option /FORCE:MULTIPLE
    The Error went away, howaever thrown a warning
    saying that Image may not boot up and it really did
    not.
  2. I set the libraris nk.lib and coredll.lib in
    TARGETLIBS in the correct order in the sources of
    Kernel and the error went away.
    However still image doesn’t boots up.
  3. then I included the coredll.lib as TARGETLIBS as
    part of hal.lib sources.
    However some functions of coredll.lib like
    InterruptInitialize are unresolved externel symbol
    while building Kernel.
    To generate kern.exe
    TARGETLIBS=nk.lib \
    hal.lib \
    fulllibc.lib \
    loadauth.lib \
    To generate hal.lib
    I have used the TARGETLIBS=coredll.lib
    then the above mentioned 3rd point came.

Can u tell me how to resolve this error.

Thanks n Regards.
Sachin Nikam.


Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

This Windows CE, and not Windows, while our forum is about Windows only.

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

----- Original Message -----
From: “Sachin Nikam.”
To: “Windows System Software Devs Interest List”
Sent: Thursday, February 02, 2006 2:01 PM
Subject: Re: [ntdev] LNK2005 error while building Kernel.

> Hello All,
>
> I am working on Windows Device Drivers.
>
> While building the kernel I am getting the following
> error.
> nk.lib(printf.obj) : error LNK2005: NKDbgPrintfW
> already defined in hal.lib(COREDLL.dll)
>
> I did some trials as below.
> 1. I used the linker option /FORCE:MULTIPLE
> The Error went away, howaever thrown a warning
> saying that Image may not boot up and it really did
> not.
> 2. I set the libraris nk.lib and coredll.lib in
> TARGETLIBS in the correct order in the sources of
> Kernel and the error went away.
> However still image doesn’t boots up.
> 3. then I included the coredll.lib as TARGETLIBS as
> part of hal.lib sources.
> However some functions of coredll.lib like
> InterruptInitialize are unresolved externel symbol
> while building Kernel.
> To generate kern.exe
> TARGETLIBS=nk.lib <br>> hal.lib <br>> fulllibc.lib <br>> loadauth.lib <br>> To generate hal.lib
> I have used the TARGETLIBS=coredll.lib
> then the above mentioned 3rd point came.
>
> Can u tell me how to resolve this error.
>
>
> Thanks n Regards.
> Sachin Nikam.
>
>
>
> __________________________________________________________
> Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.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