# JIT and libraries

**URL:** <https://root-forum.cern.ch/t/jit-and-libraries/20309>\
**Category:** Cling\
**Created:** [December 9, 2015, 10:28am UTC](https://root-forum.cern.ch/t/jit-and-libraries/20309 "2015-12-09T10:28:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![andrase](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/9fc348/32.png) [@andrase](https://root-forum.cern.ch/u/andrase)\
**Post date:** [December 9, 2015, 11:40am UTC](https://root-forum.cern.ch/t/jit-and-libraries/20309/5 "2015-12-09T11:40:01Z")

</div>

The documentation of loadFile() says:

```auto
    ///\brief Loads header file or shared library.
```

Indeed `auto const cr = dc->loadFile("libsc.a", false);` results in

/a/lnn51f2/vol/lnn51f2v7/u\_t1402742371/andrase/jit/libsc.a:1:1: error: expected unqualified-id  
!  
^  
/a/lnn51f2/vol/lnn51f2v7/u\_t1402742371/andrase/jit/libsc.a:3:1: warning: null character ignored [-Wnull-character]  
^  
…  
/a/lnn51f2/vol/lnn51f2v7/u\_t1402742371/andrase/jit/libsc.a:7:664: error: source file is not valid UTF-8  
…\<U+000F\>  
^

which suggests that cling is trying to load the file as source code instead of as a static library. I think [Fail to load shared library in Cling\<Windows\>](https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892/1) is about the same problem (although on windows).

---

_[View the full topic](https://root-forum.cern.ch/t/jit-and-libraries/20309)._
