I have created a project in “MyApp” folder using the below script:
using Pkg
Pkg.generate("../Create_exe_file/MyApp")
Pkg.activate("../Create_exe_file/MyApp")
Pkg.instantiate()
the structure of MyApp is as below::
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.
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:
I have generated the project.toml and Manifest.toml by below (however, I dont know why the size of project.toml is zero)
using Pkg
#Pkg.generate("$(@__DIR__)")
Pkg.activate("$(@__DIR__)")
Pkg.instantiate()
in precompile_app.jl, the below is written:
using MyApp
MyApp.julia_main()
in MyApp.jl, the below is written:
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:
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: