Can't find sys/socket.h when build

Operating system: Ubuntu 16.04

PlatformIO: IDE 1.7.3 | Core 3.2.1

Description of problem:
Can’t build a project using sys/socket.h. Rebuilding project index doesn’t help. Header file socket.h is in /usr/include/sys.

Actual Results:
fatal error: sys/socket.h: No such file or directory

compilation terminated.

Any help will be greatly appreciated!

A little more information will go a long way when you are explaining the symptoms of your problem.

Platform, project, what utility. Etc.
Its kinda vague for anyone to even offer an opinion.
:slight_smile:

Sorry for delayed reply.

I solved the problem by adding build_flags = -I/usr/include for [common] section in platformio.ini file.
Also install linux-libc-dev:amd64 and linux-libc-dev:i386.

Actually it is not required. It is the traditional approach which works well.
Platformio has a environment variable lib_extra_dirs which can be defined in the platformio.ini file that searches for the libraries in the directories specified here. It should accomplish the same thing.

Can you try it this way and post your feedback.

It also works with lib_extra_dirs.

Thank you!

You are welcome.
Glad to be of some help! :slight_smile: