# Can you use a module inside another module?

**URL:** <https://discourse.julialang.org/t/can-you-use-a-module-inside-another-module/60899>\
**Category:** General Usage\
**Created:** [May 10, 2021, 4:02pm UTC](https://discourse.julialang.org/t/can-you-use-a-module-inside-another-module/60899 "2021-05-10T16:02:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon60034542](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Post date:** [May 10, 2021, 4:02pm UTC](https://discourse.julialang.org/t/can-you-use-a-module-inside-another-module/60899/1 "2021-05-10T16:02:52Z")

</div>

I have a file structure like this

```julia
code - Folder
-- GameObjects.jl
-- Characters.jl

```

I want to use `GameObjects` inside `Characters.jl` but I get `GameObjects` not defined when I do:

```julia
# Characters.jl
module Characters
using .GameObjects
# Export statments
# structs and functions
end

```

I’m assuming that `.GameObjects` would behave like a sub module as specified in the [documentation](https://docs.julialang.org/en/v1/manual/modules/#Submodules-and-relative-paths)?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [May 10, 2021, 4:05pm UTC](https://discourse.julialang.org/t/can-you-use-a-module-inside-another-module/60899/2 "2021-05-10T16:05:28Z")

</div>

You are just missing an `include`:

```julia
# Characters.jl
module Characters
include("GameObjects.jl") # <-- !!
using .GameObjects
# Export statments
# structs and functions
end

```

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [May 10, 2021, 5:51pm UTC](https://discourse.julialang.org/t/can-you-use-a-module-inside-another-module/60899/3 "2021-05-10T17:51:35Z")

</div>

To expand on this, unlike in Python, file/directory names/structure does not create modules/namespaces implicitly. You have to explicitly link them with `include` and `using`.
