# How to create executable file correctly?

**URL:** <https://discourse.julialang.org/t/how-to-create-executable-file-correctly/71175>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 9, 2021, 12:24am UTC](https://discourse.julialang.org/t/how-to-create-executable-file-correctly/71175 "2021-11-09T00:24:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)\
**Post date:** [November 9, 2021, 12:24am UTC](https://discourse.julialang.org/t/how-to-create-executable-file-correctly/71175/1 "2021-11-09T00:24:43Z")

</div>

I want to make executable file for a file called `MyApp` which is located in folder `"../Create_exe_file/MyApp/src"`:

 ![1](https://global.discourse-cdn.com/julialang/original/3X/2/4/24bd6cbc91f6c8651b4287931e1113a0b3f154c4.png)  
 ![2](https://global.discourse-cdn.com/julialang/original/3X/c/8/c87ed0661aedf9c14b1c7a7f4681c3b360b07532.png)

I have created a project in “MyApp” folder using the below script:

```julia
using Pkg
Pkg.generate("../Create_exe_file/MyApp")
Pkg.activate("../Create_exe_file/MyApp")
Pkg.instantiate()

```

the structure of `MyApp` is as below::

```julia
module MyApp

function julia_main()::Cint
  try
    main_code()
  catch
      Base.invokelatest(Base.display_error, Base.catch_stack())
      return 1
  end
  return 0
end
function main_code()
#body
end

```

Then, I am trying to create the `.exe` as below. However, I am having errors.

```julia
using PackageCompiler
create_app("../Create_exe_file/MyApp", "../Create_exe_file/MyAppCompiled")

┌ Warning: it is not recommended to create an app/library without a preexisting manifest
└ @ PackageCompiler C:\Users\amroa\.julia\packages\PackageCompiler\vXKVp\src\PackageCompiler.jl:66
ERROR: LoadError: expected package to have a `name`-entry
Stacktrace:

```

@lucatrv @ianshmean  
@Simon @kristoffer.carlsson  
Could you please guide me as I read the documentation but could not follow it correctly?

---

<div class="post-metadata">

**Author:** ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)\
**Post date:** [November 10, 2021, 4:02pm UTC](https://discourse.julialang.org/t/how-to-create-executable-file-correctly/71175/2 "2021-11-10T16:02:37Z")

</div>

I have made some modifications today to make it more easier as follow"  
Now, I have one folder called `Myfolder`

 ![1](https://global.discourse-cdn.com/julialang/original/3X/f/d/fd90b6c135bb00df56d8f58693a8f77d98e32966.png)  
I have generated the `project.toml` and `Manifest.toml` by below (however, I dont know why the size of `project.toml` is zero)

```julia
using Pkg
#Pkg.generate("$(@ __DIR__ )")
Pkg.activate("$(@ __DIR__ )")
Pkg.instantiate() 

```

in `precompile_app.jl`, the below is written:

```julia
using MyApp
MyApp.julia_main()

```

in `MyApp.jl`, the below is written:

```julia
module MyApp
Base.@ccallable function julia_main()::Cint
  try
    myfunction()
  catch
      Base.invokelatest(Base.display_error, Base.catch_stack())
      return 1
  end
  return 0
end
function myfunction()
# body
end myfunction
end #module

```

I wrote the below to generate the app, however, still have error:

```julia
using PackageCompiler
create_app("$(@ __DIR__ )", "MyfolderCompiled"; precompile_execution_file="$(@ __DIR__ )/MyApp.jl/$(@ __DIR__ )/precompile_app.jl")
┌ Warning: it is not recommended to create an app/library without a preexisting manifest
└ @ PackageCompiler C:\Users\amroa\.julia\packages\PackageCompiler\vXKVp\src\PackageCompiler.jl:66
ERROR: LoadError: expected package to have a `name`-entry
Stacktrace:

```

@kristoffer.carlsson  
@lucatrv  
@ianshmean  
@viralbshah  
@tkf  
@asinghvi17  
I am sorry if tagging you is improper, I just wanted to contact the professional guy if possible. Thank you in advance!
