Fails to build on Solaris

Bug #794650 reported by Dmitry Kurochkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Polygraph
New
Undecided
Unassigned

Bug Description

Web Polygraph v4.3.2 fails to build on Solaris 10:

InetIfReq.cc: In constructor Inet6IfAliasReq::Inet6IfAliasReq(const String&, const InAddress&, const InAddress&):
InetIfReq.cc:38: error: SIOCGIFINDEX was not declared in this scope
InetIfReq.cc:40: error: struct ifreq has no member named ifr_ifindex
make[3]: *** [InetIfReq.o] Error 1

Revision history for this message
Dmitry Kurochkin (dmitry.kurochkin) wrote :

Another error:

     g++ -DHAVE_CONFIG_H -I../.. -I../../src -I../.. -I../../src -g -O3 -Wall -Wwrite-strings -Woverloaded-virtual -MT gadgets.o -MD -MP -MF .deps/gadgets.Tpo -c -o gadgets.o gadgets.cc
     gadgets.cc: In function 'double xceil(double, double)':
     gadgets.cc:32:41: error: 'ceilf' was not declared in this scope
     gadgets.cc:47:1: warning: control reaches end of non-void function

Polygraph checks if ceilf(3) is available on the system. Apparently, Solaris has ceilf(3) implemented (that is why the configure check succeeds), but does not declare it in math.h. Attached patch is a workaround to avoid ceilf(3) usage.

Revision history for this message
Dmitry Kurochkin (dmitry.kurochkin) wrote :

And one more:

        g++ -DHAVE_CONFIG_H -I../.. -I../../src -I../.. -I../../src -g -O3 -Wall -Wwrite-strings -Woverloaded-virtual -MT PolyApp.o -MD -MP -MF .deps/PolyApp.Tpo -c -o PolyApp.o PolyApp.cc
        /usr/include/net/if.h:99: error: template argument required for struct map

Solaris declares/refers common names like map in /usr/include/net/if.h and queue in /usr/include/sys/stream.h. These conflict with C++. Looks like the only option to fix this is to get rid of "using namespace std".

Revision history for this message
Igor Pashev (pashev-igor) wrote :

Easier workaround is to include <net/if.h> *before* any other headers, especially <map> :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.