# Not defined error

**URL:** <https://discourse.julialang.org/t/not-defined-error/46685>\
**Category:** New to Julia\
**Tags:** error\
**Created:** [September 16, 2020, 5:34am UTC](https://discourse.julialang.org/t/not-defined-error/46685 "2020-09-16T05:34:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 16, 2020, 5:34am UTC](https://discourse.julialang.org/t/not-defined-error/46685/1 "2020-09-16T05:34:05Z")

</div>

Sooooo confusing using Julia ☹

I don’t understand why the following simple codes doesn’t work at all with error message `AbstractGlidingVehicle not defined`.

Even my other custom package is similarly written, but that works.

Note: I’m running code as `include("test/runtests.jl")`.

+) Please let me know how to develop a custom packages and use them. It’s really confusing, especially paths of files, use of other registered packages, and precompiling with PackageCompiler.jl.  
Do I have to install the same registered packages (e.g., `LinearAlgebra.jl`) in all my custom environments? If you can, please share the easiest and clearest way to make and use custom packages…

EDIT: suddenly this code works, and it doesn’t work again with different error…  
Note: I’m using rsync and running codes on server.

EDIT2: I may found what raises error (but I don’t know why). Replacing `using Revise; includet("glidingvehicle.jl"` in `src/Environment.jl` by `include("glidingvehicle.jl")` works well.  
Then, should I re-run julia everytime I change my custom package?

EDIT3: After changing `includet("glidingvehicle.jl")` to `includet("src/glidingvehicle.jl") also works. Probably the location where I run the code is crucial in Julia, and this makes really confused. Is there any way to fix it? In my case when using Python, I used prefix `PYTHONPATH=“.”`.

`test/runtests/jl`

```julia
using Environment
using Test

function test_all()
    gv = GlidingVehicle.AbstractGlidingVehicle()
end

test_all()

```

`src/Environment.jl`

```julia
module Environment

using Revise
includet("glidingvehicle.jl")

export GlidingVehicle

end

```

`src/glidingvehicle.jl`

```julia
module GlidingVehicle

using Parameters

export AbstractGlidingVehicle

@with_kw mutable struct AbstractGlidingVehicle
    i::Int64 = 1
end

end

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 16, 2020, 8:20am UTC](https://discourse.julialang.org/t/not-defined-error/46685/2 "2020-09-16T08:20:34Z")

</div>

> [@iHany](#):
>
> ```julia
> using Revise
> includet("glidingvehicle.jl")
> 
> ```

Don’t use `Revise` within a module, and just `include` the file.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 16, 2020, 8:46am UTC](https://discourse.julialang.org/t/not-defined-error/46685/3 "2020-09-16T08:46:03Z")

</div>

Thanks!  
Then, should I repeat turn on and off REPL while developing my own packages? (to reflect the changes of the package?)  
@Tamas_Papp

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 16, 2020, 8:57am UTC](https://discourse.julialang.org/t/not-defined-error/46685/4 "2020-09-16T08:57:50Z")

</div>

> [@iHany](#):
>
> should I repeat turn on and off REPL while developing my own packages

Sorry, I don’t understand this. I would generally recommend just `using GlidingVehicle` and just Revise as intended, see

> **[Configuration · Revise.jl](https://timholy.github.io/Revise.jl/stable/config/)**
>
> Documentation for Revise.jl.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 16, 2020, 8:58am UTC](https://discourse.julialang.org/t/not-defined-error/46685/5 "2020-09-16T08:58:57Z")

</div>

Probably I don’t figure out how Revise.jl works.  
I’ll take a loot at Revise.jl again. Thanks 🙂
