# Cxx LLVM error

**URL:** <https://discourse.julialang.org/t/cxx-llvm-error/26226>\
**Category:** General Usage\
**Tags:** llvm, cxx\
**Created:** [July 10, 2019, 3:27pm UTC](https://discourse.julialang.org/t/cxx-llvm-error/26226 "2019-07-10T15:27:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hros](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hros](https://discourse.julialang.org/u/hros)\
**Post date:** [July 10, 2019, 3:27pm UTC](https://discourse.julialang.org/t/cxx-llvm-error/26226/1 "2019-07-10T15:27:54Z")

</div>

I am wrapping a C++ math library ([ntl](https://www.shoup.net/ntl/)) using [Cxx](https://github.com/JuliaInterop/Cxx.jl).  
After successfully wrapping a major class, I encountered llvm errors in another class.  
The errors are:  
**LLVM ERROR: Program used external function ‘\_\_emutls\_v.\__symbol_’ which could not be resolved!**  
where _symbol_ is replaced with the function symbol.  
checking the share library (libntl.so) the function is not missing.  
I am guessing this has to do with [Thread Local Storage](https://en.wikipedia.org/wiki/Thread-local_storage)  
NTL has the following definition:

```julia
#ifdef NTL_THREADS

#define NTL_THREAD_LOCAL thread_local

#ifdef __GNUC__
#define NTL_CHEAP_THREAD_LOCAL __thread
#else
#define NTL_CHEAP_THREAD_LOCAL thread_local
#endif

#else

#define NTL_THREAD_LOCAL
#define NTL_CHEAP_THREAD_LOCAL

#endif

```

which means that certain elements in this class are prefixed with `__thread` (which was not present in the other class I was able to wrap successfully)
