# Using PackageCompiler in windows

**URL:** <https://discourse.julialang.org/t/using-packagecompiler-in-windows/29199>\
**Category:** General Usage\
**Tags:** package\
**Created:** [September 26, 2019, 1:52pm UTC](https://discourse.julialang.org/t/using-packagecompiler-in-windows/29199 "2019-09-26T13:52:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HBaghdadi1995](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@HBaghdadi1995](https://discourse.julialang.org/u/HBaghdadi1995)\
**Post date:** [September 26, 2019, 1:52pm UTC](https://discourse.julialang.org/t/using-packagecompiler-in-windows/29199/1 "2019-09-26T13:52:46Z")

</div>

Hi, I tried building a shared library based on `hello.jl` found [here](https://github.com/JuliaLang/PackageCompiler.jl/tree/master/examples).

It created the following files:

```julia
- 7z.dll
- libccalltest.dll
- libgfortran-4.dll
- libmpfr.dll
- libssh2.dll
- libwinpthread-1.dll
- BugpointPasses.dll
- libccolamd.dll
- libgit2.dll
- libopenblas64_.dll
- libssp-0.dll
- LLVM.dll
- hello.a
- libcholmod.dll
- libgmp.dll
- libopenlibm.dll
- libstdc++-6.dll
- LLVMHello.dll
- hello.dll
- libcolamd.dll
- libjulia.dll
- libpcre2-8.dll
- libsuitesparse_wrapper.dll
- zlib1.dll
- libamd.dll
- libdSFMT.dll
- libmbedcrypto.dll
- libpcre2-posix.dll
- libsuitesparseconfig.dll
- libatomic-1.dll
- libexpat-1.dll
- libmbedtls.dll
- libquadmath-0.dll
- libumfpack.dll
- libcamd.dll
- libgcc_s_seh-1.dll
- libmbedx509.dll
- libspqr.dll
- libuv-2.dll

```

however there are some issues when it comes to linking to this.

1. It’s missing `sys.dll` which was required when I’ve previously embedded julia in my program.
2. It contains no header files to define the signatures of the functions.
3. It contains no import libraries to allow me to load the `.dll`

Sorry if some of the things here are obvious to others, I’ve always found linking to be a big challenge.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [September 26, 2019, 2:01pm UTC](https://discourse.julialang.org/t/using-packagecompiler-in-windows/29199/2 "2019-09-26T14:01:05Z")

</div>

1. hello.jl is your new sys.dll
2. they don’t get generated automatically… It should be fairly easy though, since you only get functions exported via `@ccallable` and it should be relatlively straight forward to write a new macro, that registers the ccallable function signatures and generates a header file for them… Main problem will be conversions.  
You could also just embedd hello.dll much like in the embedding examples without any header files, with the added benefit to have julia functions ahead of time compiled.
3. What do you expect exactly?

---

<div class="post-metadata">

**Author:** ![HBaghdadi1995](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@HBaghdadi1995](https://discourse.julialang.org/u/HBaghdadi1995)\
**Post date:** [September 26, 2019, 4:14pm UTC](https://discourse.julialang.org/t/using-packagecompiler-in-windows/29199/3 "2019-09-26T16:14:17Z")

</div>

Hi, thanks for your help!

1. Thanks!
2. So should I still copy the files in`Julia-[ver-num]/include/julia` to access the header files for functions such as `jl_init()`?
3. I’ve only ever added `dll`s using the VS property window, or Qmake and I’ve always had to include an import static library. For example with Julia it’s `libjulia.dll.a` and `libopenlibn.dll.a` in `[JuliaDir]\lib`. I might be mistaken but as far as I’m aware this is a must have when using windows.
