Compilers fail to find sys/_types.h include file

Questions and support problems dealing directly with the FreeBSD Operating System.
Post Reply
kirigiri
Posts: 2
Joined: Tue May 14, 2024 10:32 pm

Compilers fail to find sys/_types.h include file

Post by kirigiri »

I have installed https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.0/FreeBSD-14.0-RELEASE-amd64-memstick.img on an Intel NUC 11 i5 PC. The installation procedure reported no problems.

However, when I try to compile a C++ program either via c++13 or via g++13, I get the following error that complains of a missing sys/_types.h file. The following compile command successfully compiles the program under Ubuntu 24.04 so I'm confused that it fails to compile under FreeBSD. Can someone please help me to solve this problem? Thanks!

g++13 -lm -O3 -std=c++17 -pthread -D TEST_KD_TREE -W kdTreeKnlogn.cpp
In file included from /usr/local/lib/gcc13/include/c++/bits/cxxabi_init_exception.h:38,
from /usr/local/lib/gcc13/include/c++/bits/exception_ptr.h:36,
from /usr/local/lib/gcc13/include/c++/exception:164,
from kdTreeKnlogn.cpp:79:
/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/include/stddef.h:54:10: fatal error: sys/_types.h: No such file or directory
54 | #include <sys/_types.h>
| ^~~~~~~~~~~~~~
compilation terminated.
User avatar
neville
Developer
Posts: 123
Joined: Fri Aug 13, 2021 10:27 am
Location: Japan

Re: Compilers fail to find sys/_types.h include file

Post by neville »

Maybe try

pkg install os-generic-userland-devtools
kirigiri
Posts: 2
Joined: Tue May 14, 2024 10:32 pm

Re: Compilers fail to find sys/_types.h include file

Post by kirigiri »

Domo arrigato gozaimashita.

Your suggestion solved the problem.

Where can I read about necessary or desirable packages?
Post Reply