Skip to content

Bug: Unresolved makedev symbol when compiling with cosmoc++ #1281

@edubart

Description

@edubart

What happened?

The following example fails when compiling with C++.

#include <sys/sysmacros.h>
int main(){return makedev(1,2);}

Workaround is to use extern "C" {} when including the header <sys/sysmacros.h>, or compile as C code.

Version

cosmocc (GCC) 14.1.0

What operating system are you seeing the problem on?

Linux x86_64.

Relevant log output

cosmoc++ a.cpp -o a
/home/bart/apps/cosmocc/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: /tmp/fatcosmocc.1g6ec4iyr07v0.o: in function `main':
a.cpp:(.text+0x21): undefined reference to `makedev(unsigned int, unsigned int)'

Metadata

Metadata

Assignees

No one assigned

    Labels

    low severityUsed to report low severity bugs (e.g. cosmetic issues, non critical UI glitches)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions