# Package-Compiler stops compile process because of arguments missing

**URL:** <https://discourse.julialang.org/t/package-compiler-stops-compile-process-because-of-arguments-missing/102472>\
**Category:** General Usage\
**Tags:** argument, package-compiler, parameters\
**Created:** [August 4, 2023, 7:51am UTC](https://discourse.julialang.org/t/package-compiler-stops-compile-process-because-of-arguments-missing/102472 "2023-08-04T07:51:16Z")\
**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:** [August 4, 2023, 7:51am UTC](https://discourse.julialang.org/t/package-compiler-stops-compile-process-because-of-arguments-missing/102472/1 "2023-08-04T07:51:16Z")

</div>

Hello,

I developed a program that requires a few arguments and when the program starts, it checks whether the correct arguments were given and if not, then it raises an exception. For example:

```julia
# Read the arguments given to the Julia process.
argument_list = ARGS

    # Get the task type from the argument (parameter) given to the program when it was started.
    if length(argument_list) >= 2 && length(strip(argument_list[2])) >= 1 && is_valid_task_type(string(strip(argument_list[2])))
        const TASK_TYPE = string(strip(argument_list[2]))
    else
        throw(ArgumentError("No task type given as argument! The task type must be the FIRST argument given to the process!"))
    end

```

My problem is that when I compile my program to create a stand-alone .EXE-Application for Windows, then the compilation process stops and reports that an ArgumentError occured. It occurs because the arguments are missing. How shall I tell the package compiler to use arguments when compiling my program?

Of course, I could use

```julia
println("No task type given as argument! The task type must be the FIRST argument given to the process!")

```

instead of

```julia
throw(ArgumentError("No task type given as argument! The task type must be the FIRST argument given to the process!"))

```

However, it would be better to use ArgumentError because it is the correct type of exception.

I compile my program by using these commands:

```julia
using PackageCompiler
create_app("MyProgramName", "MyProgramNameCompiled"; precompile_execution_file = "MyProgramNamer/precompile_app.jl")

```

precompile\_app.jl contains only this here:

```julia
using MyProgramName

MyProgramName.julia_main()

```

I am using PackageCompiler v2.1.7 and Julia 1.8.5. The operating system is Windows 10.

Thanks for any advices in advance!

Kind regards,  
Miroslav Stimac
