# PackageCompiler does not compile included Julia-files!

**URL:** <https://discourse.julialang.org/t/packagecompiler-does-not-compile-included-julia-files/95443>\
**Category:** General Usage\
**Tags:** compilation, package-compiler\
**Created:** [March 2, 2023, 12:58pm UTC](https://discourse.julialang.org/t/packagecompiler-does-not-compile-included-julia-files/95443 "2023-03-02T12:58:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miroslav-Stimac](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Post date:** [March 2, 2023, 12:58pm UTC](https://discourse.julialang.org/t/packagecompiler-does-not-compile-included-julia-files/95443/1 "2023-03-02T12:58:30Z")

</div>

Hello,

I developed a program with Julia that consists of a main file called MyProgram.jl and an additional file called MyAdditionalCode.jl. In MyProgram.jl I have this content:

… # Some libraries imported via import or using.  
… # Some constants and variables declared.

function program\_main() # My real main function.  
… # Many lines of various source code.  
include(“MyAdditionalCode.jl”)  
println(my\_variable)  
… # Many lines of various source code.  
end

function julia\_main()::Cint # Used by PackageCompiler.jl  
program\_main()  
return 0  
end

In MyAdditionalCode.jl I just have this line:  
my\_variable = “123”

When I execute MyProgram.jl traditionally with Julia.exe, it works without any problems and 123 is displayed on screen.  
But when I compile it with PackageCompiler and I create all required things such as a project with a TOML project file, a julia\_main() method etc., then the program MyProgram.jl is sucessfully compiled to MyProgramCompiled.exe and the system image is created, but MyAdditionalCode.jl is NOT compiled. When I try to execute MyProgramCompiled.exe, then I get this error message:

SystemError: opening file “C:\JuliaWorkspace\MyProgram\MyProgramCompiled\bin\MyAdditionalCode.jl”: No such file or directory

If I copy MyAdditionalCode.jl from C:\JuliaWorkspace to C:\JuliaWorkspace\MyProgram\MyProgramCompiled\bin\, then the program runs without any error messages.  
However, I wonder why MyAdditionalCode.jl is not compiled?  
I expected that everything will be compiled and not just MyProgram.jl.

I am using Julia v1.8.5, PackageCompiler v2.1.5 and Windows 10 64-Bit Version.

Thank you in advance for any answers!

Kind regards,  
Miroslav Stimac
