EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: RE: Unable to mind .lib files after successfully compiling EPICS using mingw64
From: "Wang, Andrew via Tech-talk" <tech-talk at aps.anl.gov>
To: Mark Rivers <rivers at cars.uchicago.edu>, EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Tue, 29 Apr 2025 02:07:54 +0000

Hi Mark,

 

Thanks for the clarification. Not sure if you can help me with this, but I was able to get mca compiled using mex on MATLAB with this command (I removed parts of the path for just this email for reasons):

 

mex -R2017b mca.cpp MCAError.cpp Channel.cpp ...

            <TOP>\epics-base\lib\windows-x64-mingw\libCom.dll.a ...

            <TOP>\epics-base\lib\windows-x64-mingw\libca.dll.a ...

           -D_MINGW ...

           -IC:\Users\wang126\epics-base\include ...

           -IC:\Users\wang126\epics-base\include\os\WIN32 ...

           -IC:\Users\wang126\epics-base\include\compiler\gcc ...

           -v

 

On MATLAB 2024b, mex completed successfully. However when I went to run mca.mexw64, it states that:

 

Invalid MEX-file <TOP>\matlab_ca\mca.mexw64': The specified module could not be found.

 

Reading through the MATLAB forums, I used the dependency tool that came with MSVC to find what its dependencies are. They are listed below.

 

Dump of file mca.mexw64

 

File Type: DLL

 

  Image has the following dependencies:

 

    libmex.dll

    libmx.dll

    KERNEL32.dll

    msvcrt.dll

    ca.dll

    Com.dll

 

I have ca.dll and Com.dll in the same directory as mca.mexw64. The others are found in PATH. I feel like I am missing something important, but not sure what it is.

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Monday, April 28, 2025 6:18 PM
To: EPICS tech-talk <tech-talk at aps.anl.gov>; Wang, Andrew <wang126 at llnl.gov>
Subject: Re: Unable to mind .lib files after successfully compiling EPICS using mingw64

 

When you build dynamically on Windows with VS there are 2 files:

  • .lib contains the symbols
  • .dll contains the code

 

When you link, as in the Matlab Makefile, you only link with the .lib files.  It finds the .dll files at run-time.

 

When you build statically on Windows with VS there is only a .lib file, which contains both the symbols and the code.  It does not need to find .dll files at run-time.

 

I am sure pretty sure that Matlab is linking to the dynamic DLLs for ca and Com.

 

Mark

 

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, April 28, 2025 8:01 PM
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Unable to mind .lib files after successfully compiling EPICS using mingw64

 

Hi all,

 

I have been tasked with building EPICS on Windows. I was able to get it compiling using mingw64. I basically followed the instructions here (https://docs.epics-controls.org/en/latest/getting-started/installation-windows-msys2.html), albeit I did not use the tar.gz file. I instead cloned the epics-base repository.

 

I have been able to run an IOC and all of that. However, now I am trying to get mca to work, which requires com.lib and ca.lib. However, I do not see these in my lib directory. I only find com.dll.a and ca.dll.a, which to my understanding is not a static library.

 

The examples compilations in mca all use .lib. (https://github.com/epics-extensions/matlab_ca/blob/master/alt_compile/mcacompile_win64_mscc.m)

 

Please advise?

 

Purple ribbon awareness

 


Replies:
RE: Unable to mind .lib files after successfully compiling EPICS using mingw64 Freddie Akeroyd - STFC UKRI via Tech-talk
References:
Unable to mind .lib files after successfully compiling EPICS using mingw64 Wang, Andrew via Tech-talk
Re: Unable to mind .lib files after successfully compiling EPICS using mingw64 Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Unable to mind .lib files after successfully compiling EPICS using mingw64 Mark Rivers via Tech-talk
Next: Re: Use of elog inside Phoebus Florian Feldbauer via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
Navigate by Thread:
Prev: Re: Unable to mind .lib files after successfully compiling EPICS using mingw64 Mark Rivers via Tech-talk
Next: RE: Unable to mind .lib files after successfully compiling EPICS using mingw64 Freddie Akeroyd - STFC UKRI via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025