Build of brlcad-7.0.4 fails on OpenBSD 3.6

  • Sorry to bother you. When I try to compile brlcad-7.0.4 on OpenBSD 3.6-RELEASE the build fails with the following error:

    gcc -DHAVE_CONFIG_H -I. -I. -I../../include   -I../../include  -pthread -lcurses -pipe -fno-strict-aliasing -fno-common -fPIC -g -c `test -f 'Sc.c' || echo './'`Sc.c
    In file included from Sc.h:48,
                     from Sc.c:68:
    burst.h:42: conflicting types for `bool'
    /usr/include/ncurses.h:111: previous declaration of `bool'
    gmake[2]: *** [Sc.o] Error 1
    gmake[2]: Leaving directory `/home/dir21/brlcad-7.0.4/src/burst'
    gmake[1]: *** [all-recursive] Error 1
    gmake[1]: Leaving directory `/home/dir21/brlcad-7.0.4/src'
    gmake: *** [all-recursive] Error 1

    This happens if run configure as either:
         ./configure --with-cflags=-pthread --with-x
         ./configure --with-cflags="-pthread -lcurses" --with-x

    Do you know what I might do to fix it please? IOpenBSD has a relatively recentr version of ncurses in the base system:


    • James Hamilton
      James Hamilton

      I added the following to brlcad-7.0.4/src/burst/Sc.h at line 49:
        #define __STDBOOL_H__

      This was on FreeBSD 4.11 but it was the same error.  All the errors I got during ther build were easily fixed.  There was this error, and a few where the addition of "#include <sys/types.h>" before the socket.h #include fixed the error.

    • James;

      I (try to) maintain the FreeBSD port but I don't have a 4.x box to test this. If you want to send-pr patches, Id be glad to look at them. BRLCAD's site also has a problem report about this if you prefer to send them here.



    • Hi;
      Just for the record, I tried building BRLCAD 7.2.2 on FreeBSD-4.11R and I get the same error. Adding the #define doesn't fix it.
      This patch helps with other issues:

      --- src/libfb/fbserv_obj.c.orig Sat Apr 16 21:05:40 2005
      +++ src/libfb/fbserv_obj.c      Sat Apr 16 21:24:21 2005
      @@ -45,6 +45,7 @@
      #include <stdio.h>
      #include <ctype.h>

      +#include <sys/types.h>         /* For FreeBSD 4.x */
      #include <sys/socket.h>
      #include <netinet/in.h>                /* For htonl(), etc */

      --- src/libfb/if_remote.c.orig  Sat Apr 16 21:15:20 2005
      +++ src/libfb/if_remote.c       Sat Apr 16 21:35:14 2005
      @@ -46,7 +46,7 @@
      #include "common.h"

      +#include <sys/types.h>         /* For FreeBSD 4.x */
      #include <stdio.h>
      #ifdef HAVE_WRITEV
      #include <sys/uio.h>           /* for struct iovec */
      --- src/libfb/server.c.orig     Sat Apr 16 21:36:51 2005
      +++ src/libfb/server.c  Sat Apr 16 21:38:02 2005
      @@ -41,6 +41,7 @@
      #ifdef HAVE_STRING_H
      #include <string.h>
      +#  include <sys/types.h>       /* For FreeBSD 4.x */
      #if defined (HAVE_SYS_SELECT_H)
      #  include <sys/select.h>

      • Sean Morrison
        Sean Morrison


        I was clearing out old messages and came across this patch.  It's been applied to the latest sources as r31018, thanks and apologies on it almost slipping by!