• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

12.2.3 library(shlib): Utility library for loading foreign objects (DLLs, shared objects)
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • Linking Foreign Modules
          • library(shlib): Utility library for loading foreign objects (DLLs, shared objects)
            • use_foreign_library/1
            • use_foreign_library/2
            • compat_arch/2
            • load_foreign_library/1
            • load_foreign_library/2
            • unload_foreign_library/1
            • unload_foreign_library/2
            • current_foreign_library/2
            • reload_foreign_libraries/0
    • Packages
Availability::- use_module(library(shlib)).(can be autoloaded)
Source[det]use_foreign_library(+FileSpec)
[det]use_foreign_library(+FileSpec, +Options:list)
Load and install a foreign library as load_foreign_library/1,2 and register the installation using initialization/2 with the option now. This is similar to using:
:- initialization(load_foreign_library(foreign(mylib))).

but using the initialization/1 wrapper causes the library to be loaded after loading of the file in which it appears is completed, while use_foreign_library/1 loads the library immediately. I.e. the difference is only relevant if the remainder of the file uses functionality of the C-library.

As of SWI-Prolog 8.1.22, use_foreign_library/1,2 is in provided as a built-in predicate that, if necessary, loads library(shlib). This implies that these directives can be used without explicitly loading library(shlib) or relying on demand loading.

ClioPatria (version V3.1.1-51-ga0b30a5)