[CMake] How to find dll's on Cygwin? (fwd)

Hendrik Sattler post at hendrik-sattler.de
Sat Oct 28 02:08:23 EDT 2017


Hi,

looking at the location of the gnat static library, it seems to be a compiler library like libm. You usually do not use find_package on those but directly use -lgnat and the compiler knows how to find it. Requesting static linking will also work then.

HS


Am 28. Oktober 2017 05:38:19 MESZ schrieb "Alan W. Irwin" <irwin at beluga.phys.uvic.ca>:
>On 2017-10-27 22:31+0200 Marco Atzeri wrote:
>
>> On 27/10/2017 09:32, Alan W. Irwin wrote:
>>> I am pretty sure there are a non-zero number of CMake users here who
>>> have had CMake experience finding dll's on Cygwin (since it appears
>>> from the quote below that import libraries can be replaced by dll's
>>> for the purposes of linking on that platform).  So if you are one
>with
>>> such experience, I would really appreciate an answer to (or commment
>>> on) the specific question below concerning finding cyggnat-6.dll on
>>> Cygwin or if you prefer to frame your response to the more general
>>> question of finding dll's on that platform, that would be great as
>>> well.
>>> 
>>> Alan
>>
>> using the import library is the standard way for linking,
>> looking for the shared library is surely unusual.
>>
>> I am not a user of ADA, but the import libraries seems
>> the one on /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/
>
>Hi Marco:
>
>Thanks for your input to the discussion.
>
>I believe you are referring to
>/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/libgnat.a
>
>(at least that appears to be the only library candidate I can come up
>with
>by searching for the RE
>
>"usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/.*gnat"
>
>using the <http://cygwin.com/cgi-bin2/package-grep.cgi> package search
>engine.)
>
>Our understanding is the Cygwin naming convention for the various
>kinds of libraries would be (in the gnat library case)
>
>dll               cyggnat-6.dll
>import library    libgnat-6.dll.a
>static library    libgnat.a
>
>If you use the above search engine to search for the RE "gnat.*dll" it
>only finds the above dll and no corresponding import library.
>
>We are pretty sure from its name that libgnat.a is just a static
>library. Anyhow, when we link our test_ada library against libgnat.a
>that link does appear to work, but afterward when linking Ada
>executables against our Ada library (which involves a gnatlink step
>with hidden link to one form of the gnat library but likely also
>cyggnat-6.dll) we get multiple symbol definition errors. That linking
>inconsistency does not happen if we link our Ada library against
>cyggnat-6.dll so it appears that is the library CMake needs to find in
>this case.
>
>Which neatly ( :-) ) leads back to my original question which is what
>is the
>best CMake logic to find that dll?
>
>Alan
>
>__________________________
>Alan W. Irwin
>
>Astronomical research affiliation with Department of Physics and
>Astronomy,
>University of Victoria (astrowww.phys.uvic.ca).
>
>Programming affiliations with the FreeEOS equation-of-state
>implementation for stellar interiors (freeeos.sf.net); the Time
>Ephemerides project (timeephem.sf.net); PLplot scientific plotting
>software package (plplot.sf.net); the libLASi project
>(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
>and the Linux Brochure Project (lbproject.sf.net).
>__________________________
>
>Linux-powered Science
>__________________________
>-- 
>
>Powered by www.kitware.com
>
>Please keep messages on-topic and check the CMake FAQ at:
>http://www.cmake.org/Wiki/CMake_FAQ
>
>Kitware offers various services to support the CMake community. For
>more information on each offering, please visit:
>
>CMake Support: http://cmake.org/cmake/help/support.html
>CMake Consulting: http://cmake.org/cmake/help/consulting.html
>CMake Training Courses: http://cmake.org/cmake/help/training.html
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/cmake

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.


More information about the CMake mailing list