Unresolved Externals creating driver

From: Susan (susan_at_pile_HATE_SPAM_DOT_com)
Date: 10/04/04


Date: Mon, 4 Oct 2004 14:22:54 -0400

Well, I'm a little disappointed in myself in that I'm resorting to help this
early, but...

All I'm trying to do is take the current USB Mass Storage Class and create
an identical driver, under a different name.

I've tried three different scenarios, in order to create a 'dummy' driver
based on the USB Mass Storage Driver class. In all three cases, I wind up
with undefined externals/multiply defined objects. (I thought maybe I didn'
t create my platform correctly - didn't pull in all the needed files, but
one of my attempts at creating this 'dummy' driver doesn't even use PB. And
I get the exact same error messages.)

I grab the directory

C:\WINCE420\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\STORAGE\CLASS

and copy it to

C:\WINCE420\PLATFORM\ARMINTEGRATOR\DRIVERS

then rename the directory 'USBPDI'.

Now, according to "How to Create a Device Driver" (from MS instructions), I
am supposed to rename the "sample driver files to names that correspond with
the intended functionality of" my driver. So,

usbmsc.c becomes usbpdi.c

usbmscp.h becomes usbpdip.h

(OK. On my third attempt I ran out of descriptive names for device
functionality, and was very close to becoming crass.)

The files 'sources' is edited:

TARGETNAME = USBMSC_LIB becomes TARGETNAME=USBPDI_LIB

SOURCES = \

    BOT.C \

    CBIT.C \

    USBMSC.C \

becomes

SOURCES = \

    BOT.C \

    CBIT.C \

    USBPDI.C \

Finally,

WINCEOEM=1

is added to the 'sources' file.

I have a 'platform' created into which I add a project of type WCE dynamic
link library - an empty project. Once created, I drag all the files in
directory

C:\WINCE420\PLATFORM\ARMINTEGRATOR\DRIVERS

into the newly created project. (Well, all the files except 'makefile'.)

Naturally, I didn't change the #include directives to match the above
changes, so I have to edit bot.h, cbit.h and usbpdi.c, and change

#include "usbmscp.h" to #include "usbpdip.h"

I build once again, only to get "Cannot open include file: 'warning.h': No
such file or directory". So I add the following data to the Project
Settings, C/C++ tab, Additional Include Directories:
C:\WINCE420\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\COMMON

And rebuild. And get "Cannot open include file: 'usbmsc.h': No such file or
directory".

So back to the same Tab in the Project Settings to add

C:\WINCE420\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\STORAGE\INC

to the Additional Include Directories.

Rebuild.

And this is where it all falls apart.

I get in this vicious circle of putting in a reference to a library, then
having the build complain about multiply defined symbols.

Complaint: unresolved external symbol ResetDefaultEndpoint referenced in
function BOT_MassStorageReset

So I add usbd_lib.lib as an Object/Library Module on the Link tab of Project
Settings, and since the build still complains, I also have to give it the
path where it can find that darn library. So as an Additional Library Path,
I add C:\WINCE420\PUBLIC\COMMON\OAK\LIB\ARMV4I\RETAIL

Now I have "error LNK2005: ClosePipe already defined in usbpdi.obj", in
addition to the original error about ResetDefaultEndpoint.

And no matter what I do, I can't seem to resolve these?

>From another post, I read that all I should need to include is usbd_lib.lib.

Obviously, whatever I'm during wrong, I'm doing CONSISTENTLY wrong, since I
can't get away from these messages.

I'm leaning towards the problem being in the paths I added via Project
Settings - meaning I should not have hardcoded the values, but used more
'generic' versions. But, I haven't been able (yet) to determine what those
'generic' paths should look like.

Any help would be appreciated.



Relevant Pages

  • Re: Unresolved Externals creating driver
    ... Keep it a sources/dirs component in the BSP as you have already. ... > an identical driver, under a different name. ... > So back to the same Tab in the Project Settings to add ... > having the build complain about multiply defined symbols. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Unresolved Externals creating driver
    ... > an identical driver, under a different name. ... > So back to the same Tab in the Project Settings to add ... > having the build complain about multiply defined symbols. ...
    (microsoft.public.windowsce.platbuilder)
  • [PATCH 19-rc1] Fix typos in /Documentation : U-Z
    ... when the underlying device was capable of handling the i/o in one shot. ... using dev->irq by the device driver to request for interrupt service ... The EMU10K2 chips have a DSP part which can be programmed to support ... -(This acticle does not deal with the overall functionality of the ...
    (Linux-Kernel)
  • Re: help for teacher
    ... >> The students use notepad a lot. ... >> the settings after they log on. ... printer through the driver which I suppose will come up. ... then if they can drag and drop to it, I imagine they will be able to get into ...
    (microsoft.public.windows.server.scripting)
  • Re: display settings adjusted automatically
    ... called "advanced settings" and the Adapter can be configured to load a particular "scheme". ... Please go to Display Properties, Settings, Advanced button, and look for "Accelerator driver" or similar. ... When you done your Installation did you install the Video Driver for your motherboard from the Manufacturer who built your Motherboard if your Video Card integrated into the motherboard?. ...
    (microsoft.public.windowsxp.general)