Re: Unresolved Externals creating driver

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


Date: Mon, 4 Oct 2004 15:03:27 -0400

And I needed usbd.lib, so all I'm left with is

corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol
WinMain referenced in function WinMainCRTStartup
INTEL_DBPXA250_DEV_PLATFORM_ARMV4IRel/USBPDI.exe : fatal error LNK1120: 1
unresolved externals
Error PB2505: Error executing link.exe.

I think I needed to walk away from my desk for a few minutes!

"Susan" <susan@pile_HATE_SPAM_DOT_com> wrote in message
news:%23bmYuRkqEHA.868@TK2MSFTNGP10.phx.gbl...
> So, I shouldn't have added usbd_lib.lib since that does cinldue ClosePipe
> (as does one of my source files).
>
> Removing that, and adding the library usbclient.lib, is now have
>
> usbpdi.obj : error LNK2019: unresolved external symbol
> RegisterClientSettings referenced in function USBInstallDriver
> usbpdi.obj : error LNK2019: unresolved external symbol
> RegisterClientDriverID referenced in function USBInstallDriver
> usbpdi.obj : error LNK2019: unresolved external symbol
> UnRegisterClientDriverID referenced in function USBUnInstallDriver
> usbpdi.obj : error LNK2019: unresolved external symbol
> UnRegisterClientSettings referenced in function USBUnInstallDriver
> corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol
> WinMain referenced in function WinMainCRTStartup
>
> But this is progress, so I'm much happier.
>
>
> "Susan" <susan@pile_HATE_SPAM_DOT_com> wrote in message
> news:uBItk8jqEHA.3868@TK2MSFTNGP15.phx.gbl...
> > 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
    ... usbpdi.obj: error LNK2019: unresolved external symbol ... > an identical driver, under a different name. ... > I get in this vicious circle of putting in a reference to a library, ... > having the build complain about multiply defined symbols. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: [PATCH 1/1] : hwmon - new chip driver for TI ADS7828 A-D
    ... revised patch. ... driver, which seems to work well with the hardware I'm working with (a ... Operate with the internal 2.5v reference - set to N for external reference ...
    (Linux-Kernel)
  • Device callback object isnt referenced by the framework
    ... a while using "Developing Drivers with the Windows Driver Foundation" and the ... callback object doesn't implement any of the interfaces, ... I noticed that the fx won't take a reference to my device object as ... my driver crashes when they try to reference my device callback object ...
    (microsoft.public.development.device.drivers)
  • Re: [PATCH] fix rmmod sbp2 hang in 2.6.7
    ... Is the 'sg' driver loaded. ... When I load my SCSI HBA driver, ... It's because sg also got a reference. ... rmmod 'sg' then the rmmod of st frees up too. ...
    (Linux-Kernel)
  • Re: Trying to build berkeleyDB module against M$ VStudio 2005 SDK stuff
    ... The failing command was: ... ran into several other similar occurrences. ... BerkeleyDB.obj: error LNK2019: unresolved external symbol ...
    (comp.lang.perl.modules)