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)'
What happened?
The following example fails when compiling with C++.
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