Michel
Sun Feb 12 19:14:54 CST 2006
Just for your info, here are the two sources files before merging them:
DLL folder:
TARGETNAME=bthuart
TARGETTYPE=DYNLINK
RELEASETYPE=PLATFORM
SYNCHRONIZE_DRAIN=1
DLLENTRY=_DllMainCRTStartup
DEFFILE=$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\bthuart.def
SOURCELIBS=\
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\bthuart_lib.lib \
TARGETLIBS=\
$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\ceosutil.lib \
$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
SOURCES=
SRC folder:
WINCEOEM=1
TARGETNAME=bthuart_lib
TARGETTYPE=LIBRARY
TARGETDEFNAME=bthuart
RELEASETYPE=PLATFORM
DEFFILE=bthuart.def
WINCETARGETFILE0=$(_RELEASELIBDIR)\$(TARGETDEFNAME).def
INCLUDES=$(_PUBLICROOT)\COMMON\SDK\INC;\
$(_PUBLICROOT)\COMMON\OAK\INC;\
$(INCLUDES)
SOURCES= hciuart.cxx
Merged:
WINCEOEM=1
TARGETNAME=bthuart
TARGETTYPE=DYNLINK
TARGETDEFNAME=bthuart
RELEASETYPE=PLATFORM
DEFFILE=bthuart.def
WINCETARGETFILE0=$(_RELEASELIBDIR)\$(TARGETDEFNAME).def
DLLENTRY=_DllMainCRTStartup
INCLUDES=$(_PUBLICROOT)\COMMON\SDK\INC;\
$(_PUBLICROOT)\COMMON\OAK\INC;\
$(INCLUDES)
TARGETLIBS=\
$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\ceosutil.lib \
$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
SOURCES= hciuart.cxx
-------------
Disclaimer: I just build the stuff, did not try it.
Grz,
Michel Verhagen, eMVP
Embedded Fusion
michel at embeddedfusion dot com
Michel Verhagen (eMVP) wrote:
> You have to follow Steve's column on cloning the public source sentence
> by sentence. If you miss any step, it won't work.
>
> Here's what I did:
>
> 1. Create folder Bluetooth\SRC in my platform dir.
> 2. Copy contents of Public bluetooth UART folder into that dir
> 3. Modified sources according to column
> 4. create Bluetooth\DLL in my platform dir
> 5. run sysgen_capture bthuart
> 6. Check everything according to column
> 7. Copy \MyPlatform\Bluetooth\SRC to \MyPlatform\Bluetooth
> 8. Merge two sources files from \SRC and \DLL together and store in
> \MyPlatform\Bluetooth
> 9. Build in \MyPlatform\Bluetooth
> 10. Delete \Myplatform\Bluetooth\SRC and \DLL folder
>
> The result is the following sources file (and it works):
> ----------------------
> WINCEOEM=1
> TARGETNAME=bthuart
> TARGETTYPE=DYNLINK
> TARGETDEFNAME=bthuart
> RELEASETYPE=PLATFORM
>
> DEFFILE=bthuart.def
> WINCETARGETFILE0=$(_RELEASELIBDIR)\$(TARGETDEFNAME).def
>
> DLLENTRY=_DllMainCRTStartup
>
> INCLUDES=$(_PUBLICROOT)\COMMON\SDK\INC;\
> $(_PUBLICROOT)\COMMON\OAK\INC;\
> $(INCLUDES)
>
> TARGETLIBS=\
> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\ceosutil.lib \
> $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
>
> SOURCES= hciuart.cxx
> -----------------
>
> So, you can either reproduce the steps above, or just copy the public
> bthuart files into your platform\Bluetooth folder and use the sources
> file above (NO NEED FOR separate SRC and DLL folders!).
>
> Hope this helps,
>
> Michel Verhagen
> EmbeddedFusion
> michel at embeddedfusion dot com
>
>
>
> skindiver wrote:
>> thanks for the help.
>> looks like it should be btuart.def ... this sources file was generated
>> from the sysgen_capture tool. (???)
>> when I change it to BTHUART I get:
>>
>> BUILD: [01:0000000035:PROGC ] Linking
>> C:\WINCE500\platform\GUMSTIXI\target\ARMV4
>> I\debug\btd.dll
>> BUILD: [01:0000000053:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl sdp_InitializeOnce(void)" (?sdp_InitializeOnce@@YAHXZ) already
>> defined in b
>> tstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000054:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl sdp_CreateDriverInstance(void)"
>> (?sdp_CreateDriverInstance@@YAHXZ) already
>> defined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000055:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl sdp_CloseDriverInstance(void)" (?sdp_CloseDriverInstance@@YAHXZ)
>> already de
>> fined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000056:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl sdp_UninitializeOnce(void)" (?sdp_UninitializeOnce@@YAHXZ)
>> already defined
>> in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000057:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl SDP_EstablishDeviceContext(void *,struct SDP_EVENT_INDICATION
>> *,struct SDP_
>> CALLBACKS *,struct SDP_INTERFACE *,void * *)"
>> (?SDP_EstablishDeviceContext@@YAHP
>> AXPAUSDP_EVENT_INDICATION@@PAUSDP_CALLBACKS@@PAUSDP_INTERFACE@@PAPAX@Z)
>> already
>> defined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000058:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl SDP_CloseDeviceContext(void *)"
>> (?SDP_CloseDeviceContext@@YAHPAX@Z) already
>> defined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000059:ERRORE] sdpbase.lib(sdpbase.obj) : error
>> LNK2005: "int __c
>> decl sdp_ProcessConsoleCommand(unsigned short *)"
>> (?sdp_ProcessConsoleCommand@@Y
>> AHPAG@Z) already defined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000060:ERRORE] sdpbase.lib(sdpns.obj) : error LNK2005:
>> "int __cde
>> cl bthns_InitializeOnce(void)" (?bthns_InitializeOnce@@YAHXZ) already
>> defined in
>> btstubs.lib(sdpns_s.obj)
>> BUILD: [01:0000000061:ERRORE] sdpbase.lib(sdpns.obj) : error LNK2005:
>> "int __cde
>> cl bthns_CreateDriverInstance(void)"
>> (?bthns_CreateDriverInstance@@YAHXZ) alread
>> y defined in btstubs.lib(sdpns_s.obj)
>> BUILD: [01:0000000062:ERRORE] sdpbase.lib(sdpns.obj) : error LNK2005:
>> "int __cde
>> cl bthns_CloseDriverInstance(void)"
>> (?bthns_CloseDriverInstance@@YAHXZ) already
>> defined in btstubs.lib(sdpns_s.obj)
>> BUILD: [01:0000000063:ERRORE] sdpbase.lib(sdpns.obj) : error LNK2005:
>> "int __cde
>> cl bthns_UninitializeOnce(void)" (?bthns_UninitializeOnce@@YAHXZ)
>> already define
>> d in btstubs.lib(sdpns_s.obj)
>> BUILD: [01:0000000064:ERRORE] sdpbase.lib(sdpns.obj) : error LNK2005:
>> "void __cd
>> ecl sdp_LoadWSANameSpaceProvider(void)"
>> (?sdp_LoadWSANameSpaceProvider@@YAXXZ) a
>> lready defined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000065:ERRORE] sdpbase.lib(sdpns.obj) : error LNK2005:
>> "void __cd
>> ecl sdp_UnLoadWSANameSpaceProvider(void)"
>> (?sdp_UnLoadWSANameSpaceProvider@@YAXX
>> Z) already defined in btstubs.lib(sdp_s.obj)
>> BUILD: [01:0000000066:ERRORE]
>> C:\WINCE500\platform\GUMSTIXI\target\ARMV4I\debug\
>> btd.dll : fatal error LNK1169: one or more multiply defined symbols found
>>
>>
>>
>>
>> If I remove the btstubs.lib from the sources file I get:
>>
>> BUILD: [01:0000000035:PROGC ] Linking
>> C:\WINCE500\platform\GUMSTIXI\target\ARMV4
>> I\debug\btd.dll
>> BUILD: [01:0000000053:ERRORE] btsysd.lib(bthstack.obj) : error
>> LNK2019: unresolv
>> ed external symbol "int __cdecl pan_InitializeOnce(void)"
>> (?pan_InitializeOnce@@
>> YAHXZ) referenced in function "int __cdecl bth_InitializeOnce(void)"
>> (?bth_Initi
>> alizeOnce@@YAHXZ)
>> BUILD: [01:0000000054:ERRORE] btsysd.lib(bthstack.obj) : error
>> LNK2019: unresolv
>> ed external symbol "int __cdecl pan_CreateDriverInstance(void)"
>> (?pan_CreateDriv
>> erInstance@@YAHXZ) referenced in function "int __cdecl
>> bth_CreateDriverInstance(
>> void)" (?bth_CreateDriverInstance@@YAHXZ)
>> BUILD: [01:0000000055:ERRORE] btsysd.lib(bthstack.obj) : error
>> LNK2019: unresolv
>> ed external symbol "int __cdecl pan_CloseDriverInstance(void)"
>> (?pan_CloseDriver
>> Instance@@YAHXZ) referenced in function "int __cdecl
>> bth_CloseDriverInstance(voi
>> d)" (?bth_CloseDriverInstance@@YAHXZ)
>> BUILD: [01:0000000056:ERRORE] btsysd.lib(bthstack.obj) : error
>> LNK2019: unresolv
>> ed external symbol "int __cdecl pan_UninitializeOnce(void)"
>> (?pan_UninitializeOn
>> ce@@YAHXZ) referenced in function "int __cdecl
>> bth_UninitializeOnce(void)" (?bth
>> _UninitializeOnce@@YAHXZ)
>> BUILD: [01:0000000057:ERRORE]
>> C:\WINCE500\platform\GUMSTIXI\target\ARMV4I\debug\
>> btd.dll : fatal error LNK1120: 4 unresolved externals
>>
>>
>> Got it down to these 4 link errors ...but now I am stuck.
>> Any Ideas??
>>
>>
>>
>>
>>
>>
>>
>> "Anthony Pellerin" <apellerin@nospam_adeneo.adetelgroup.com> wrote in
>> message news:%237TBwphLGHA.740@TK2MSFTNGP12.phx.gbl...
>>> Why is DEFFILE = btsvc.def? Shouldn't it be bthuart.def ?
>>> This seems to be the problem.
>>>
>>> HTH
>>>
>>> --
>>> --
>>> --
>>> ----------------------------------------------------------------
>>> Anthony Pellerin
>>> ADENEO (ADESET)
>>> Windows Embedded Consultant
>>> <apellerin AT adeneo DOT adetelgroup DOT com>
>>>
http://www.adeneo.adetelgroup.com
>>> Tél : +33 (0)4.72.18.57.77
>>> Fax : +33 (0)4.72.18.57.78
>>> ----------------------------------------------------------------
>>> "skindiver" <xd@ttt.com> a écrit dans le message de news:
>>> %23qWsj4dLGHA.1424@TK2MSFTNGP12.phx.gbl...
>>>> I have a custom Bluetooth module that uses a uart channel on my CPU
>>>> for its interface.
>>>> I am attempting to use the "Bluetooth stack with integrated uart
>>>> driver".
>>>> The uart driver in the
>>>> C:\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\BLUETOOTH\TRANSPORTS\UART
>>>> is not exactly what I want (I need to make a few tweaks). I know I
>>>> should not modify the code in the public directory so I copied to my
>>>> local platform dir and added a \bluetooth\src and \bluetooth\dll
>>>> under my platform\src\driver tree.
>>>> I copied the files from the public set the RELEASETYPE=PLATFORM etc
>>>> etc.
>>>> It uart lib builds OK. I next did the sysgen_capture thing to get
>>>> sources.btd I renamed sources and added a makefile to the dll
>>>> directory. sources looks like:
>>>>
>>>> TARGETNAME=btd
>>>>
>>>> TARGETTYPE=DYNLINK
>>>> RELEASETYPE=PLATFORM
>>>> SYNCHRONIZE_DRAIN=1
>>>>
>>>> DLLENTRY=_DllMainCRTStartup
>>>>
>>>> DEFFILE=$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\btsvc.def
>>>>
>>>> SOURCELIBS=\
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\bthci.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\l2cap.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\sdpbase.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\sdpparse.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\rfcomm.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\btsysd.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\bttdi.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\bthuart.lib
>>>>
>>>> TARGETLIBS=\
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\cclib.lib \
>>>> $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\ceosutil.lib \
>>>> $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
>>>> $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\bthguid.lib \
>>>> $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\btstubs.lib
>>>>
>>>> SOURCES=
>>>>
>>>> I then just tried to build it. (unmodified) I get the following errors:
>>>>
>>>> BUILD: [00:0000000007:PROGC ] Scan
>>>> \WINCE500\PLATFORM\Gumstixi\Src\Drivers\Bluetooth\DLL\
>>>> BUILD: [00:0000000008:PROGC ] Saving
>>>> C:\WINCE500\PLATFORM\Gumstixi\Build.dat.
>>>> BUILD: [00:0000000010:PROGC ] Compiling
>>>> \WINCE500\PLATFORM\Gumstixi\Src\Drivers\
>>>> Bluetooth\DLL\ directory.
>>>> BUILD: [01:0000000017:PROGC ] Linking
>>>> C:\WINCE500\platform\GUMSTIXI\lib\ARMV4I\debug\btd.lib
>>>> BUILD: [01:0000000026:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Close
>>>> BUILD: [01:0000000027:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Deinit
>>>> BUILD: [01:0000000028:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_IOControl
>>>> BUILD: [01:0000000029:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Init
>>>> BUILD: [01:0000000030:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Open
>>>> BUILD: [01:0000000031:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_PowerDown
>>>> BUILD: [01:0000000032:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_PowerUp
>>>> BUILD: [01:0000000033:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Read
>>>> BUILD: [01:0000000034:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Seek
>>>> BUILD: [01:0000000035:ERRORE] btsvc.def : error LNK2001: unresolved
>>>> external symbol BTS_Write
>>>> BUILD: [01:0000000036:ERRORE]
>>>> C:\WINCE500\platform\GUMSTIXI\lib\ARMV4I\debug\btd.lib : fatal error
>>>> LNK1120: 10 unresolved externals
>>>>
>>>>
>>>>
>>>>
>>>> How do I resolve these errors so I can take the next steps?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>