Skip to content

including <net/socket.h> fails with redefinition of 'struct zsock_timeval' (sometimes :-) ) #41503

Closed
@boaks

Description

@boaks

I'm using nRFConnect 1.8.0 and zephyr v2.7.0-ncs1.

If I include <net/socket.h> always as the first, then some files compile well, and some reports

5> In file included from /ncs/zephyr/include/net/socket.h:29,
5> /ncs/zephyr/include/net/socket_select.h:112:17:Kerror: redefinition of 'struct zsock_timeval'
5> In file included from /ncs/zephyr/include/net/socket_select.h:18,
5> from /ncs/zephyr/include/net/socket.h:29,
5> /ncs/zephyr/include/net/socket_types.h:43:8:note: originally defined here

The files are added to the project with

target_sources(app PRIVATE src/a???.c)
target_sources(app PRIVATE src/b???.c)

both file use the same first include

#include <net/socket.h>

For one, it works, for the other it fails. If I remove the failing from the project, the build finishes.
That is very irritating. Has someone similar experience?

Metadata

Metadata

Assignees

Labels

area: NetworkingbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions