DDK Link error : LNK2019: unresolved external symbol _AtaPortCon

Hi,

I am developing ata miniport dirver.
I am using DDK(7600) to buid the driver for Winodes 7. I get some build errors saying unresolved symbols.
Does anyone have the same experience and know how to solve the issue?

Build error as follows:

C:\MyAtapi>build -cZe
BUILD: Compile and Link for x86
BUILD: Start time: Fri Oct 14 09:34:07 2011
BUILD: Examining c:\Myatapi directory for files to compile.
c:\myatapi Invalidating OACR warning log for ‘root:x86chk’
BUILD: Compiling and Linking c:\Myatapi directory
Configuring OACR for ‘root:x86chk’ -
Compiling resources - myatapi.rc
Compiling - myatapi.c
errors in directory c:\myatapi
c:\myatapi\myatapi.obj : error LNK2019: unresolved external symbol _AtaPortCon
xxxxx@4 referenced in function _GetABARAddress@8
c:\myatapi\objchk_win7_x86\i386\myatapi.sys : error LNK1120: 1 unresolved exte
rnals
BUILD: Finish time: Fri Oct 14 09:34:09 2011
BUILD: Done

4 files compiled - 2 Errors

C:\MyAtapi>

source file as follows:

TARGETNAME=myatapi
TARGETTYPE=MINIPORT

TARGETLIBS=$(DDK_LIB_PATH)\pciidex.lib <br> $(DDK_LIB_PATH)\ntoskrnl.lib <br> $(DDK_LIB_PATH)\hal.lib

SOURCES=MyAtapi.c <br> MyAtapi.rc

RUN_WPP= $(SOURCES) -km -func:TracePrint((LEVEL,FLAGS,MSG,…))

TARGET_DESTINATION=retail

# Macro to create marker for Boot Driver embedded signing.
BOOT_LOADER_CRITICAL=1

thanks and regards,
pavan

You need also include ATAport.lib in TARGETLIBS.

Michael Xing

To find a .lib file that contains a symbol:

Cd \winddk\7600.16385\lib
Findstr /msi AtaPortCon .lib

Then you can list of .lib files that have symbol.
Then you can add that lib to your sources file.

Probably it is ataport.lib

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Thursday, October 13, 2011 9:30 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] DDK Link error : LNK2019: unresolved external symbol
_AtaPortCon

Hi,

I am developing ata miniport dirver.
I am using DDK(7600) to buid the driver for Winodes 7. I get some build
errors saying unresolved symbols.
Does anyone have the same experience and know how to solve the issue?

Build error as follows:

C:\MyAtapi>build -cZe
BUILD: Compile and Link for x86
BUILD: Start time: Fri Oct 14 09:34:07 2011
BUILD: Examining c:\Myatapi directory for files to compile.
c:\myatapi Invalidating OACR warning log for ‘root:x86chk’
BUILD: Compiling and Linking c:\Myatapi directory Configuring OACR for
‘root:x86chk’ - Compiling resources - myatapi.rc Compiling -
myatapi.c errors in directory c:\myatapi c:\myatapi\myatapi.obj : error
LNK2019: unresolved external symbol _AtaPortCon
xxxxx@4 referenced in function _GetABARAddress@8
c:\myatapi\objchk_win7_x86\i386\myatapi.sys : error LNK1120: 1 unresolved
exte rnals
BUILD: Finish time: Fri Oct 14 09:34:09 2011
BUILD: Done

4 files compiled - 2 Errors

C:\MyAtapi>

source file as follows:

TARGETNAME=myatapi
TARGETTYPE=MINIPORT

TARGETLIBS=$(DDK_LIB_PATH)\pciidex.lib <br> $(DDK_LIB_PATH)\ntoskrnl.lib <br> $(DDK_LIB_PATH)\hal.lib

SOURCES=MyAtapi.c <br> MyAtapi.rc

RUN_WPP= $(SOURCES) -km -func:TracePrint((LEVEL,FLAGS,MSG,…))

TARGET_DESTINATION=retail

# Macro to create marker for Boot Driver embedded signing.
BOOT_LOADER_CRITICAL=1

thanks and regards,
pavan


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

I checked, In ataport.lib its counterpart
AtaPortConvertPhysicalAddressToUlong avaliable but not
AtaPortConvertUlongToPhysicalAddress :frowning:

I looked again both ATAport.lib and PCIIDEX.lib. Seems this function is missed from publishing. You may need a work around of avoiding this API.

Regards,
Michael Xing