# Fail to load shared library in Cling\<Windows\>

**URL:** <https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892>\
**Category:** Cling\
**Created:** [September 24, 2015, 11:28am UTC](https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892 "2015-09-24T11:28:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muthu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@Muthu](https://root-forum.cern.ch/u/Muthu)\
**Post date:** [September 24, 2015, 11:28am UTC](https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892/1 "2015-09-24T11:28:48Z")

</div>

Hi All,

I am working with cling in windows platform, and I tried executing “Cling.exe .L test.lib”.  
But it thrown below error.

* * *

test.lib:3:76: error:  
source file is not valid UTF-8  
…\<U+0000\>\<U+0000\>F\<U+0002\>\<U+0000\>\<U+0000\>F\<U+0002\>\<U+0000\>\<U+0000\>B  
^  
test.lib:3:77: warning:  
null character ignored [-Wnull-character]  
…\<U+0000\>\<U+0000\>F\<U+0002\>\<U+0000\>\<U+0000\>F\<U+0002\>\<U+0000\>\<U+0000\>B  
^  
^  
test.lib:3:80: error:  
source file is not valid UTF-8  
…  
^  
test.lib:3:84: error:  
source file is not valid UTF-8  
…\<96\>  
^  
test.lib:3:90: warning:  
null character ignored [-Wnull-character]  
…  
^  
test.lib:3:92: error:  
source file is not valid UTF-8  
…\<98\>  
^  
test.lib:3:93: warning:  
null character ignored [-Wnull-character]  
…  
^  
test.lib:3:96: error:  
source file is not valid UTF-8  
…  
^  
test.lib:3:97: warning:  
null character ignored [-Wnull-character]  
…  
^  
test.lib:3:98: warning:  
null character ignored [-Wnull-character]  
…  
^  
test.lib:3:100: error:  
source file is not valid UTF-8  
…  
^  
test.lib:3:101: warning:

```
  null character ignored [-Wnull-character]

```

## … ^ ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] [cling]$

Please help me to resolve this.

Thanks and regards,  
Muthu

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 24, 2015, 12:17pm UTC](https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892/2 "2015-09-24T12:17:04Z")

</div>

Hi,

cling does’t recognize .lib as a binary library. It’s probably just not implemented, or it might not work (but you need a DLL). You could have a look at DynamicLibraryManager to see where it goes wrong, and whether this is supported in llvm at all.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![Muthu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@Muthu](https://root-forum.cern.ch/u/Muthu)\
**Post date:** [October 7, 2015, 11:48am UTC](https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892/3 "2015-10-07T11:48:50Z")

</div>

Thanks Axel,

I added “.L test.dll” and verified but unfortunately when I accessed functions in .dll through cling, it threw me error “Maybe you need to load corresponding shared library”??? any idea, how to load a shared library?  
Meanwhile I will also debug Cling and try to find the root cause. Please share me if you have any input on this

Muthu.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [October 20, 2015, 12:09am UTC](https://root-forum.cern.ch/t/fail-to-load-shared-library-in-cling-windows/19892/4 "2015-10-20T00:09:40Z")

</div>

Hi,

does the DLL export the symbols?

Axel.
