Hello PocketPC developer folks..

I am working in EVC v4.2 with the PocketPC 2003 SDK (Armv4Dbg) target. I
am converting a static C and C++ library to a DLL. I've referenced all the
usual
headers required like "time.h", "stdlib.h", etc.

I need to use several "old" (libc.lib style) functions: time(), ctime(),
asctime() and difftime(). When I build the library as a static library,
these
link in just fine. When I attempt to build the library as a DLL (with or
without MFC support), the reference to "difftime()" links in just fine, but
I get a
"unresolved externals" on "time()", "ctime()", and "asctime()". A quick
check using "dumpbin" on coredll.lib shows that "difftime()" symbol is
present, but no
"time()", or "ctime()" (perhaps these are inlined elsewhere?). Which
build-time switches, or additional binary static or DLL should I use to
resolve these "unresolved externals"? Why would the PPC 2003 SDK static
library build with no problems...while the DLL form with same sources, does
not? I'm sure I'm missing something very simple.

The project parameters I've used are: "New|WinCE DLL" ...also tried
defining the DLL as one with MFC...

Here is the EVC v4.2 emitted error report:
----------------------------------------------------------------------------
-----------------
Creating library ARMV4Dbg/ce4.lib and object ARMV4Dbg/ce4.exp
lCoreSupport.obj : error LNK2019: unresolved external symbol time referenced
in function lCoreSeedPNRG
lSession.obj : error LNK2019: unresolved external symbol time referenced in
function lSessionTimerElapsed
lSession.obj : error LNK2019: unresolved external symbol ctime referenced in
function lSessionClose
ARMV4Dbg/ce4.dll : fatal error LNK1120: 2 unresolved externals
----------------------------------------------------------------------------
-----------------
Any help would be very appreciated!!

cheers,
Joe Glassy

Re: Linker error building DLL with old time(),ctime(), difftime() functions - ideas? by Chris

Chris
Thu Dec 30 17:17:40 CST 2004

GetSystemTime/GetLocalTime to get the time

Convert to a FILETIME with SystemTimeToFileTime

Do your math

Convert back with FileTimeToSystemTime

SetLocalTime/SetSystemTime

you could macro them into time, difftime, etc.

--
<ctacke/>
www.OpenNETCF.org
Your CF searches start and end here


"Joe Glassy" <jglassy@lupinelogic.com> wrote in message
news:OrPmMCr7EHA.2788@TK2MSFTNGP15.phx.gbl...
> Hello PocketPC developer folks..
>
> I am working in EVC v4.2 with the PocketPC 2003 SDK (Armv4Dbg) target. I
> am converting a static C and C++ library to a DLL. I've referenced all
> the
> usual
> headers required like "time.h", "stdlib.h", etc.
>
> I need to use several "old" (libc.lib style) functions: time(), ctime(),
> asctime() and difftime(). When I build the library as a static library,
> these
> link in just fine. When I attempt to build the library as a DLL (with or
> without MFC support), the reference to "difftime()" links in just fine,
> but
> I get a
> "unresolved externals" on "time()", "ctime()", and "asctime()". A quick
> check using "dumpbin" on coredll.lib shows that "difftime()" symbol is
> present, but no
> "time()", or "ctime()" (perhaps these are inlined elsewhere?). Which
> build-time switches, or additional binary static or DLL should I use to
> resolve these "unresolved externals"? Why would the PPC 2003 SDK static
> library build with no problems...while the DLL form with same sources,
> does
> not? I'm sure I'm missing something very simple.
>
> The project parameters I've used are: "New|WinCE DLL" ...also tried
> defining the DLL as one with MFC...
>
> Here is the EVC v4.2 emitted error report:
> ----------------------------------------------------------------------------
> -----------------
> Creating library ARMV4Dbg/ce4.lib and object ARMV4Dbg/ce4.exp
> lCoreSupport.obj : error LNK2019: unresolved external symbol time
> referenced
> in function lCoreSeedPNRG
> lSession.obj : error LNK2019: unresolved external symbol time referenced
> in
> function lSessionTimerElapsed
> lSession.obj : error LNK2019: unresolved external symbol ctime referenced
> in
> function lSessionClose
> ARMV4Dbg/ce4.dll : fatal error LNK1120: 2 unresolved externals
> ----------------------------------------------------------------------------
> -----------------
> Any help would be very appreciated!!
>
> cheers,
> Joe Glassy
>
>