# Build system: create\_module recent changes

**URL:** <https://ziggit.dev/t/build-system-create-module-recent-changes/3940>\
**Category:** Help\
**Tags:** language\
**Created:** [April 13, 2024, 12:38am UTC](https://ziggit.dev/t/build-system-create-module-recent-changes/3940 "2024-04-13T00:38:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias](https://ziggit.dev/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathias](https://ziggit.dev/u/Mathias)\
**Post date:** [April 13, 2024, 12:38am UTC](https://ziggit.dev/t/build-system-create-module-recent-changes/3940/1 "2024-04-13T00:38:56Z")

</div>

Hi.  
I recently updated to the latest build of the compiler and now my build.zig no longer works. I have created a module with create\_module. I used to add it to the exe with exe.add\_module(). This no longer works and I can’t figure out how to connect my module to the executable.  
Appreciate any help!

---

<div class="post-metadata">

**Author:** ![dude\_the\_builder](https://ziggit.dev/user_avatar/ziggit.dev/dude_the_builder/32/557_2.png) [@dude\_the\_builder](https://ziggit.dev/u/dude_the_builder)\
**Post date:** [April 13, 2024, 12:51am UTC](https://ziggit.dev/t/build-system-create-module-recent-changes/3940/2 "2024-04-13T00:51:50Z")

</div>

To create a private module to use withing your project:

```zig
    const mod = b.createModule(.{
        .root_source_file = .{ .path = "src/mod.zig" },
        .target = target,
        .optimize = optimize,
    });

```

and then you add it to your `exe`:

```zig
exe.root_module.addImport("mod", mod);

```

If you want to provide the module for users to use in their projects, use `addModule` instead:

```zig
    const mod = b.addModule("mod", .{
        .root_source_file = .{ .path = "src/mod.zig" },
        .target = target,
        .optimize = optimize,
    });

```

---

<div class="post-metadata">

**Author:** ![Mathias](https://ziggit.dev/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathias](https://ziggit.dev/u/Mathias)\
**Post date:** [April 13, 2024, 2:21am UTC](https://ziggit.dev/t/build-system-create-module-recent-changes/3940/3 "2024-04-13T02:21:39Z")

</div>

@dude_the_builder Ahh. .root\_module… almost as if they were hiding it 😉  
Thank you!!
