EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Bug 1853168] Re: undefined reference to `clock_gettime'
From: mdavidsaver via Core-talk <[email protected]>
To: [email protected]
Date: Tue, 19 Nov 2019 22:47:32 -0000
I think the clock_gettime() and CLOCK_REALTIME definitions are pulled in through
the following condition in time.h.

> /* POSIX 2008 says clock_gettime and timespec are defined in time.h header,
>    but other systems - like Linux, Solaris, etc - tend to declare such
>    recent extensions only if the following guards are met.  */
> #if !defined(IN_WINPTHREAD) && \
> 	((!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
> 	 (_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__))
> #include <pthread_time.h>
> #endif

https://github.com/mirror/mingw-w64/blob/3ac71ed3105c2989ba378e2e88d9405f65797178/mingw-w64-headers/crt/time.h#L302-L309

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1853168

Title:
  undefined reference to `clock_gettime'

Status in EPICS Base:
  New

Bug description:
  I'm getting this linker error when building Base 3.15.6 with mingw:

  /usr/bin/x86_64-w64-mingw32-g++ -o Com.dll -shared -Wl,--out-
  implib,libCom.dll.a
  -L/home/travis/.cache/base-R3.15.6/lib/windows-x64-mingw       -m64
  -static-libgcc -static-libstdc++            asLib.obj asTrapWrite.obj
  bucketLib.obj postfix.obj calcPerform.obj cvtFast.obj resourceLib.obj
  epicsOnce.obj epicsSingletonMutex.obj dbmf.obj ellLib.obj ellSort.obj
  envSubr.obj envData.obj errlog.obj errSymLib.obj errSymTbl.obj
  fdmgr.obj fdManager.obj freeListLib.obj gpHashLib.obj iocsh.obj
  registry.obj libComRegister.obj iocLog.obj logClient.obj macCore.obj
  macEnv.obj macUtil.obj alarmString.obj aToIPAddr.obj adjustment.obj
  cantProceed.obj epicsConvert.obj epicsExit.obj epicsStdlib.obj
  epicsString.obj truncateFile.obj ipAddrToAsciiAsynchronous.obj
  epicsUnitTest.obj epicsThread.obj epicsMutex.obj epicsEvent.obj
  epicsTime.obj epicsMessageQueue.obj epicsMath.obj epicsAtomicOSD.obj
  epicsGeneralTime.obj osiClockTime.obj osdSock.obj osdSockAddrReuse.obj
  osiSock.obj systemCallIntMech.obj epicsSocketConvertErrnoToString.obj
  osdAssert.obj osdFindSymbol.obj osdInterrupt.obj osdPoolStatus.obj
  osdSignal.obj osdEnv.obj epicsReadline.obj epicsTempFile.obj
  epicsStdio.obj osdStdio.obj osdThread.obj osdThreadExtra.obj
  osdThreadHooks.obj osdMutex.obj osdSpin.obj osdEvent.obj osdTime.obj
  osdProcess.obj osdNetIntf.obj osdMessageQueue.obj devLibVME.obj
  devLibVMEOSD.obj epicsStackTrace.obj osdBackTrace.obj osdFindAddr.obj
  poolJob.obj threadPool.obj epicsRingPointer.obj epicsRingBytes.obj
  taskwd.obj epicsTimer.obj timer.obj timerQueue.obj
  timerQueueActive.obj timerQueueActiveMgr.obj timerQueuePassive.obj
  yajl.obj yajl_alloc.obj yajl_buf.obj yajl_encode.obj yajl_gen.obj
  yajl_lex.obj yajl_parser.obj epicsGetopt.obj setThreadName.obj
  forceBadAllocException.obj  Com.coff    -lws2_32 -ladvapi32 -luser32
  -lws2_32

  osiClockTime.obj:osiClockTime.c:(.text+0xb4): undefined reference to
  `clock_gettime'

  osiClockTime.obj:osiClockTime.c:(.text+0x33b): undefined reference to
  `clock_gettime'

  collect2: error: ld returned 1 exit status

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1853168/+subscriptions

References:
[Bug 1853168] [NEW] undefined reference to `clock_gettime' Dirk Zimoch via Core-talk

Navigate by Date:
Prev: [Bug 1853148] Re: mingw compiler problem with printf/scanf formats mdavidsaver via Core-talk
Next: Re: New day/time for teleconference? Ralph Lange via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: [Bug 1853168] Re: undefined reference to `clock_gettime' Andrew Johnson via Core-talk
Next: [Bug 1853168] Re: undefined reference to `clock_gettime' Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 20 Nov 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·