Hi Andrew,
When building asyn and any module that uses asyn under mingw the Windows library winmm must be linked with. This is because not long ago I added the function to asynSetMinTimerPeriod() to asyn/miscellaneous/asynShellCommands.c. This function is only built on _WIN32. It allows decreasing the timer clock minimum period from 10 ms to 1 ms which can be very useful. At the time I added it I suggested this should really be put in base, not in asyn but I added it there to get it deployed quickly.
The asyn Makefile has the line:
asyn_SYS_LIBS_WIN32 = ws2_32 Winmm
On Microsoft compilers I believe this is sufficient to ensure that all applications built with asyn will be linked with winmm, because I never needed to add winmm to the SYS_LIBS when building products. However, for mingw this is not true, winmm must be explicitly linked with.
It would be a real pain to modify every Makefile that builds products that use asyn to include this SYS_LIB! So instead I made this change, adding -lwinmm to the OP_SYS_LDLIBS in base.
corvette:base-3.15.4/configure/os>diff CONFIG.linux-x86.win32-x86-mingw.orig CONFIG.linux-x86.win32-x86-mingw
23,24c23,24
< # Link with winsock2
< OP_SYS_LDLIBS = -lws2_32
---
> # Link with winsock2 and mm
> OP_SYS_LDLIBS = -lws2_32 -lwinmm
I think this would be a good thing to add to EPICS base. It is harmless when asyn is not being used, and if you do decide to move the setMinTimerPeriod from asyn to base then it will be needed there anyway.
Mark
________________________________________
From: Mark Rivers
Sent: Wednesday, August 24, 2016 10:02 PM
To: Johnson, Andrew N.
Subject: RE: mingw woes
Hi Andrew,
I just figured it out.
asyn.lib is linked with winmm, a Windows system library. On Microsoft that is sufficient to ensure that all applications built with asyn.lib also link with winnm. On mingw that is not true, the applications must also be explicitly linked with winmm.
Another question: when I build base with mingw it builds some dlls, and also large .lib files. However, in the synApps tree it does not build any .dll files, only large .lib files. I have actually been able to build softGlue OK, but I worry it is not a fair test, because it seems to be building statically, not dynamically?
Thanks,
Mark
________________________________________
From: Johnson, Andrew N. [[email protected]]
Sent: Wednesday, August 24, 2016 9:58 PM
To: Mark Rivers
Subject: Re: mingw woes
Hi Mark,
The _WIN32 macro means the OS interface uses the Win32 API, not that the compiler is the Microsoft one. Mingw uses tine Win32 API (headers, libraries etc.) with gcc as the compiler, so _WIN32 is meant to be defined for that target. There may be code in libCom/osi/os/Win32 that is Mingw specific, and I think there's a macro too.
I don't know what Winmm is, are you missing a header or a library? I would suggest a Google search to see if anyone else has the same error and a solution.
- Andrew
- Replies:
- Re: mingw woes Michael Davidsaver
- Re: mingw woes Andrew Johnson
- Navigate by Date:
- Prev:
Attn: procServ 2.6.1-rc2 released Ralph Lange
- Next:
Re: mingw woes Michael Davidsaver
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
<2016>
2017
2018
2019
2020
2021
2022
2023
- Navigate by Thread:
- Prev:
Attn: procServ 2.6.1-rc2 released Ralph Lange
- Next:
Re: mingw woes Michael Davidsaver
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
<2016>
2017
2018
2019
2020
2021
2022
2023
|