Skip to content

'DT_CHR' undeclared when compiling print3d #45

@companje

Description

@companje

When compiling print3d on OSX (without Docker) I get the error below. I think the #define __USE_BSD is not sufficient on OSX to let the #include <dirent.h> define DT_CHR which has the value 2. As a workaround I added #define DT_CHR 2 to ipc_shared.c. That seems to work.

[  9%] Building C object CMakeFiles/ipc_shared.dir/ipc_shared.c.o
/Volumes/OpenWrt/openwrt/build_dir/target-mips_34kc_musl-1.1.14/print3d/ipc_shared.c: In function 'ipc_find_devices':
/Volumes/OpenWrt/openwrt/build_dir/target-mips_34kc_musl-1.1.14/print3d/ipc_shared.c:112:23: error: 'DT_CHR' undeclared (first use in this function)
    if (ent->d_type == DT_CHR && strncmp(ent->d_name, name, strlen(name)) == 0) {
                       ^
/Volumes/OpenWrt/openwrt/build_dir/target-mips_34kc_musl-1.1.14/print3d/ipc_shared.c:112:23: note: each undeclared identifier is reported only once for each function it appears in
make[5]: *** [CMakeFiles/ipc_shared.dir/ipc_shared.c.o] Error 1
make[4]: *** [CMakeFiles/ipc_shared.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [/Volumes/OpenWrt/openwrt/build_dir/target-mips_34kc_musl-1.1.14/print3d/.built] Error 2
make[2]: Leaving directory `/Volumes/OpenWrt/openwrt/customfeeds/print3d'
make[1]: *** [package/feeds/customfeeds/print3d/compile] Error 2
make[1]: Leaving directory `/Volumes/OpenWrt/openwrt'
make: *** [package/print3d/compile] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions