Tries to find all available versions of the shared libraries used in
Just the usual
zef install Native::FindVersion.
It exports a single function,
latest-version. An example (from the test)
constant $lib-name = "gcc_s";
$version = latest-version($lib-name);
sub __addvdi3( int32 $a, int32 $b) returns int32 is native($lib-name, $version )
say __addvdi3( 3, 3 )
Since the version needs to be known at compile time, it needs to be assigned
BEGIN phase. You can use either the short form (
foo) or the
long form (
In this case we're using a shared library and function that can be found in
most Linux systems,
For ease of use, there's a function that returns directly the
constant @native-arg = latest-version-arg("gcc_s");
sub gcc-mod( int32 $a, int32 $b)
NativeLib::Searcher that will help you find a library using the symbols
found in it and a range of possible versions.
Untested in Windows and MacOS. If they don't append the version number to the
extension, it will not work.
(c) JJ Merelo, firstname.lastname@example.org 2022
This module will be licensed, by default, under the Artistic 2.0 License (the same as Raku itself).