Opened 9 years ago
Last modified 9 years ago
#3639 assigned defect
MinGW linker finds pre-built MSVC library
Reported by: | Owned by: | Adrian Pop | |
---|---|---|---|
Priority: | normal | Milestone: | Future |
Component: | Third-Party Libraries | Version: | |
Keywords: | Cc: |
Description
If an external Modelica library comes with a pre-built MSVC-win32 library (e.g., in the Resources\Library\win32 directory) then the MinGW linker of OM on Windows tries to link such library and fails. See https://github.com/tbeu/ExternData/issues/9#issuecomment-173542620 for a reported issue and https://trac.modelica.org/Modelica/ticket/1316 for an unfinished discussion on Modelica.
How can a library developer prevent such a linker problem? I did not yet test if the linking is successful if the appropriate MinGW libraries are provided next to (or instead) the MSVC libraries.
Change History (2)
comment:1 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
Note that it must also be the same version of MinGW that the library is compiled against, since MinGW versions are not compatible.
If there was a supported BuildProject (autotools), OM might try to compile it (I don't think lib-files are recognized as libraries by OMC, only by GCC). LoadLibrary for a dll often seems to work better than linking a lib-file directly.
OM also knows of the platform name
mingw32
. I think if there was aResources/Library/mingw32
, that would be preferred over win32.I guess Adrian knows more about Windows issues.