ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

When will I need to define HAVE_IFADDRS_H?

asked 2011-12-31 23:37:28 -0500

Hi! I am figuring out the mechanism in the roscpp package, and I found there's codes in the function determineHost() in network.cpp:

#ifdef HAVE_IFADDRS_H

...

#endif

There's a comment : fall back on interface search, which will yield an IP address

But I don't know what does it mean~

Can someone give me a brief explanation?

Thanks in advance, Ricky.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-01-01 12:01:22 -0500

ahendrix gravatar image

The HAVE_IFADDRS_H symbol is defined by the ros build system if your system has the ifaddrs.h header; you should never have to define it yourself.

It looks like that particular chunk of code is trying to find an outward-facing IP address to use to identify the computer it's running on.

If you want more information about it, I suggest reading the man page for getifaddrs.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-12-31 23:37:28 -0500

Seen: 334 times

Last updated: Jan 01 '12