Ticket #1099 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

build errors on Glib.UTFString

Reported by: guest Owned by: duncan
Priority: normal Milestone:
Component: build system Version: 0.9.12
Keywords: Cc:

Description (last modified by duncan) (diff)

Using the most recent Darcs, I am having trouble building gtk2hs.

The configure goes fine:

gwern@localhost:1033~/bin/gtk2hs>./configure --prefix=$HOME/bin/                                                                    [11:47PM]
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ar... /usr/bin/ar
checking for ld... /usr/bin/ld
checking for basename... /usr/bin/basename
checking for grep that handles long lines and -e... /bin/grep
checking for gzip... /bin/gzip
checking for a sed that does not truncate output... /bin/sed
checking for cut... /usr/bin/cut
checking for tar... /bin/tar
checking for touch... /usr/bin/touch
checking for ranlib... ranlib
checking for ghc... /home/gwern/bin/bin/ghc
checking version of GHC... 6.9.20071201
checking for ghc-pkg... /home/gwern/bin/bin/ghc-pkg
checking for the GHC package "mtl"... yes, version 1.1.0.0
checking for the GHC package "bytestring"... yes, version 0.9
checking for the GHC package "containers"... yes, version 0.1
checking for the GHC package "array"... yes, version 0.1
checking for the GHC package "old-time"... yes, version 1.0
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for GTK... yes
checking for LIBGLADE... yes
checking whether to build glade package... yes
checking for GCONF... yes
checking whether to build gconf package... yes
checking for SOURCEVIEW... no
checking whether to build sourceview package... no
checking for MOZILLA_MOZEMBED... no
checking whether to build mozembed package... no
checking for SEAMONKEY_MOZEMBED... no
checking whether to build mozembed package... no
checking for FIREFOX_MOZEMBED... no
checking whether to build mozembed package... no
checking for XULRUNNER_MOZEMBED... no
checking whether to build mozembed package... no
checking for CAIRO... yes
checking whether to build cairo package... yes
checking for SVGCAIRO... yes
checking whether to build svgcairo package... yes
checking for GTKGLEXT... yes
checking whether to build gtkglext package... yes
checking for GNOMEVFS... yes
checking whether to build gnomevfs package... yes
checking for GSTREAMER... yes
checking whether to build gstreamer package... yes
checking whether to build deprecated bindings... yes
checking for hsc2hs... /home/gwern/bin/bin/hsc2hs
checking for happy... /usr/bin/happy
checking version of happy... 1.17
checking for alex... /usr/bin/alex
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tools/c2hs/toplevel/C2HSConfig.hs
config.status: creating gtk2hs.spec
config.status: creating mk/chsDepend
config.status: creating mk/link-splitobjs.sh
config.status: creating docs/prologue.txt
config.status: creating glib/glib.package.conf
config.status: creating glib/glib.cabal
config.status: creating gtk/gtk.package.conf
config.status: creating gtk/gtk.cabal
config.status: creating glade/glade.package.conf
config.status: creating glade/glade.cabal
config.status: creating gconf/gconf.package.conf
config.status: creating gconf/gconf.cabal
config.status: creating sourceview/sourceview.package.conf
config.status: creating sourceview/sourceview.cabal
config.status: creating mozembed/mozembed.package.conf
config.status: creating mozembed/mozembed.cabal
config.status: creating cairo/cairo.package.conf
config.status: creating cairo/cairo.cabal
config.status: creating svgcairo/svgcairo.package.conf
config.status: creating svgcairo/svgcairo.cabal
config.status: creating gtkglext/gtkglext.package.conf
config.status: creating gtkglext/gtkglext.cabal
config.status: creating soegtk/soegtk.package.conf
config.status: creating soegtk/soegtk.cabal
config.status: creating gnomevfs/gnomevfs.package.conf
config.status: creating gnomevfs/gnomevfs.cabal
config.status: creating gstreamer/gstreamer.package.conf
config.status: creating gstreamer/gstreamer.cabal
config.status: creating gtk2hs-config.h
config.status: gtk2hs-config.h is unchanged
config.status: executing depfiles commands
config.status: executing default commands
**************************************************
* Configuration completed successfully.           
*                                                 
* The following packages will be built:           
*                                                 
* glib          : yes                             
* gtk           : yes                             
* glade         : yes              
* cairo         : yes                 
* svgcairo      : yes              
* gtkglext      : yes              
* gconf         : yes                 
* sourceview    : no            
* mozembed      : no              
* soegtk        : yes                             
* gnomevfs      : yes              
* gstreamer     : yes             
* documentation : no                    
*                                                 
* Now do "(g)make" followed by "(g)make install"
**************************************************


But then when I build, it eventually errors out as follows:

gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp:202: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp:249: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp:274: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp:68: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp:90: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp:105: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp:76: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp:108: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Pango/Types.chs.pp:171: error: missing expression between '(' and ')'
gtk/Graphics/UI/Gtk/Pango/Types.chs.pp:296: error: missing expression between '(' and ')'
glib/System/Glib/GDateTime.chs.pp:31: error: missing expression between '(' and ')'
glib/System/Glib/GDateTime.chs.pp:48: error: missing expression between '(' and ')'
glib/System/Glib/GDateTime.chs.pp:105: error: missing expression between '(' and ')'
glib/System/Glib/GDateTime.chs.pp:226: error: missing expression between '(' and ')'
glib/System/Glib/GObject.chs.pp:38: error: missing expression between '(' and ')'
glib/System/Glib/GObject.chs.pp:88: error: missing expression between '(' and ')'

glib/System/Glib.hs:13:0:
Failed to load interface for `System.Glib.UTFString':
Use -v to see a list of the files searched for.
make[1]: *** [glib/System/Glib.o] Error 1
make: *** [all] Error 2

Attachments

make-log.txt (211.5 kB) - added by guest 7 years ago.
make > make-log.txt (abbreviated)
paned.log (111.9 kB) - added by guest 7 years ago.
make.log (162.5 kB) - added by guest 7 years ago.
make2.log (212.0 kB) - added by guest 7 years ago.

Change History

Changed 7 years ago by guest

make > make-log.txt (abbreviated)

  Changed 7 years ago by guest

Anything that says "failed to load interface file for" usually means that somebody added a new import statement somewhere but that the dependencies haven't been updated yet to reflect that. Dependency calculating is only done once in a clean tree due to performance reasons. Please delete all */*.deps files and try again.

Axel.

  Changed 7 years ago by duncan

  • owner changed from somebody to duncan
  • component changed from general (Gtk+, Glib) to build system
  • description modified (diff)

So the first error was:

gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp:202: error: missing expression between '(' and ')'

gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp line 202 is:

#if GTK_CHECK_VERSION(2,4,0)

So it looks like that macro is not getting defined properly. It should be defined in gtk2hs-config.h which gets included when pre-processing. What command was it exactly that gave all those errors? Was it ghc -M or cpp or c2hs?

Try these commands and attach the log of what happens, including what commands make runs and any error messages.

touch gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp
make gtk/Graphics/UI/Gtk/Abstract/Paned.hs

  Changed 7 years ago by guest

Ok, so I went and checked out a fresh copy. In it I ran the following command:

darcs pull -a && autoreconf && make clean && ./configure --prefix=$HOME/bin/ --with-user-pkgconf && touch gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp && make gtk/Graphics/UI/Gtk/Abstract/Paned.hs 2>~/paned.log && make -d 2>~/make.log

Changed 7 years ago by guest

Changed 7 years ago by guest

Changed 7 years ago by guest

follow-up: ↓ 6   Changed 7 years ago by guest

(Might as well add that the 'touch/make' pair of commands for Paned didn't seem to change anything.)

  Changed 7 years ago by jesusalbertosanchez@…

I have the same problem compiling the development version in ubuntu 7.10 32bit with the official binary distribution of ghc 6.8.2, it seems that the problem is that c2hsLocan can't parse glib-objcet.i, i get the following message, trying to make the glib bindings:

./tools/c2hs/c2hsLocal +RTS -RTS -C-I/usr/include/glib-2.0 -C-I/usr/lib/glib-2.0/include --cppopts='-include "gtk2hs-config.h"' --precomp=glib/glib.precomp glib-object.h En el fichero incluído de /usr/include/glib-2.0/glib/gthread.h:32,

de /usr/include/glib-2.0/glib/gasyncqueue.h:30, de /usr/include/glib-2.0/glib.h:32, de /usr/include/glib-2.0/gobject/gtype.h:26, de /usr/include/glib-2.0/gobject/gboxed.h:26, de /usr/include/glib-2.0/glib-object.h:25:

/usr/include/glib-2.0/glib/gutils.h:426:1: aviso: se redefinió "GLIB_CHECK_VERSION" En el fichero incluído de <línea de orden>:1: ./gtk2hs-config.h:179:1: aviso: esta es la ubicación de la definición previa c2hsLocal: Error in C header file.

<interno>:1: (column 0) [FATAL]

>>> Lexical error! The character '#' does not fit here.

make[2]: *** [glib/glib.precomp] Error 1 make[2]: se sale del directorio `/home/alberto/tmp/gtk2hs' make[1]: *** [glib/System/Glib/Types.hs] Error 2 make[1]: se sale del directorio `/home/alberto/tmp/gtk2hs'

in reply to: ↑ 4   Changed 7 years ago by guest

Replying to guest:

(Might as well add that the 'touch/make' pair of commands for Paned didn't seem to change anything.)

Sorry for the later reply.

I think your problem is quite different from the problem of parsing gobject.i which I've filed as a new bug #1101. From looking at make-log.txt your system is using gcc -E to pre-process files. As Duncan has pointed out, it seems that the GTK_CHECK_VERSION macro is not defined, which is should be in gtk2hs-config.h in the gtk2hs main directory. Could you upload that file so we can have a look?

Ta, Axel.

follow-up: ↓ 8   Changed 7 years ago by anonymous

OK, so I pulled a fresh repo today to try try again:

<no location info>: can't find file: glib/System/Glib/GObject.hs make[1]: *** Deleting file `glib/libHSglib_a.p_deps' gcc -E -x c -traditional-cpp -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -include gtk2hs-config.h glib/System/Glib/GDateTime.chs.pp -o glib/System/Glib/GDateTime.chs glib/System/Glib/GDateTime.chs.pp:31: error: missing expression between '(' and ')' glib/System/Glib/GDateTime.chs.pp:48: error: missing expression between '(' and ')' glib/System/Glib/GDateTime.chs.pp:105: error: missing expression between '(' and ')' glib/System/Glib/GDateTime.chs.pp:226: error: missing expression between '(' and ')' gcc -E -x c -traditional-cpp -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -include gtk2hs-config.h glib/System/Glib/GObject.chs.pp -o glib/System/Glib/GObject.chs glib/System/Glib/GObject.chs.pp:38: error: missing expression between '(' and ')' glib/System/Glib/GObject.chs.pp:88: error: missing expression between '(' and ')' rm -rf glib/System/Glib.o glib/System/Glib_split/; mkdir -p glib/System/Glib_split /usr/bin/ghc +RTS -RTS -split-objs -c glib/System/Glib.hs -o glib/System/Glib.o -O -fffi -iglib -package-conf package.conf.inplace -hide-all-packages -ignore-package glib -package base -package-name glib-0.9.12.2 '-#include<glib-object.h>' -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include

glib/System/Glib.hs:13:0: Failed to load interface for `System.Glib.UTFString': Use -v to see a list of the files searched for. make[1]: *** [glib/System/Glib.o] Error 1 make[1]: Leaving directory `/home/gwern/bin/gtk2hs' make: *** [all] Error 2 make 136.33s user 29.31s system 91% cpu 3:01.00 total

--

Since the error has changed, I dunno if gtk2hs-config.h will still be helpful, but I will attach it anyway.

in reply to: ↑ 7   Changed 7 years ago by guest

Hm. I no longer see any attachment option. Well, inline it:

/* gtk2hs-config.h. Generated from gtk2hs-config.h.in by configure. */ /* gtk2hs-config.h.in. Generated from configure.ac by autoheader. */

/* Hack to suppress warnings that these symbols clash with

the ones from ghc's version of config.h */

#undef /**/ PACKAGE_NAME #undef /**/ PACKAGE_STRING #undef /**/ PACKAGE_TARNAME #undef /**/ PACKAGE_VERSION

/* Leave out all deprecated functions. */ /* #undef DISABLE_DEPRECATED */

/* Whether or not the cairo package is available. */ #define ENABLE_CAIRO

/* cairo pdf backend enabled */ #define ENABLE_CAIRO_PDF_SURFACE

/* cairo png functions available */ #define ENABLE_CAIRO_PNG_FUNCTIONS

/* cairo ps backend enabled */ #define ENABLE_CAIRO_PS_SURFACE

/* cairo svg backend enabled */ #define ENABLE_CAIRO_SVG_SURFACE

/* Whether or not the firefox package is available. */ /* #undef ENABLE_FIREFOX_MOZEMBED */

/* Whether or not the gconf package is available. */ #define ENABLE_GCONF

/* Whether or not the gnomevfs package is available. */ #define ENABLE_GNOMEVFS

/* Whether or not the gstreamer package is available. */ #define ENABLE_GSTREAMER

/* Whether or not the opengl package is available. */ #define ENABLE_GTKGLEXT

/* Whether or not the libglade package is available. */ #define ENABLE_LIBGLADE

/* Whether or not the mozilla package is available. */ #define ENABLE_MOZILLA_MOZEMBED

/* Whether or not the seamonkey package is available. */ /* #undef ENABLE_SEAMONKEY_MOZEMBED */

/* Whether or not the sourceview package is available. */ /* #undef ENABLE_SOURCEVIEW */

/* Whether or not the svg package is available. */ #define ENABLE_SVGCAIRO

/* Whether or not the xulrunner package is available. */ /* #undef ENABLE_XULRUNNER_MOZEMBED */

/* Omit deprecated gdk functions. */ /* #undef GDK_DISABLE_DEPRECATED */

/* Omit deprecated pixbuf functions. */ /* #undef GDK_PIXBUF_DISABLE_DEPRECATED */

/* Omit deprecated gtk functions. */ /* #undef GTK_DISABLE_DEPRECATED */

/* Define this if we need to hack around a broken development version of Gtk+

(2.1.0) that for some reason Sun decided it'd be a really good idea for them to ship. Grrr. */

/* #undef GTK_MULTIHEAD_SAFE */

/* Omit deprecated glib functions. */ /* #undef G_DISABLE_DEPRECATED */

/* Using split base package. */ #define HAVE_SPLIT_BASE 1

/* The mozembed library directory */ #define MOZEMBED_LIBDIR ""

/* Name of package */ #define PACKAGE "gtk2hs"

/* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */ #define PACKAGE_NAME "gtk2hs"

/* Define to the full name and version of this package. */ #define PACKAGE_STRING "gtk2hs 0.9.12.2"

/* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gtk2hs"

/* Define to the version of this package. */ #define PACKAGE_VERSION "0.9.12.2"

/* Use the new GClosure based signals implementation. */ #define USE_GCLOSUE_SIGNALS_IMPL

/* Version number of package */ #define VERSION "0.9.12.2"

/* cairo major version number */ #define _CAIRO_MAJOR_VERSION (1)

/* cairo minor patch level */ #define _CAIRO_MICRO_VERSION (12)

/* cairo minor version number */ #define _CAIRO_MINOR_VERSION (5)

/* Glib major version number */ #define _GLIB_MAJOR_VERSION ()

/* Glib minor patch level */ #define _GLIB_MICRO_VERSION ()

/* Glib minor version number */ #define _GLIB_MINOR_VERSION ()

/* Glib major version number */ #define _GSTREAMER_MAJOR_VERSION ()

/* Glib minor patch level */ #define _GSTREAMER_MICRO_VERSION ()

/* Glib minor version number */ #define _GSTREAMER_MINOR_VERSION ()

/* Gtk major version number */ #define _GTK_MAJOR_VERSION ()

/* Gtk minor patch level */ #define _GTK_MICRO_VERSION ()

/* Gtk minor version number */ #define _GTK_MINOR_VERSION ()

/* Pango major version number */ #define _PANGO_MAJOR_VERSION ()

/* Pango minor patch level */ #define _PANGO_MICRO_VERSION ()

/* Pango minor version number */ #define _PANGO_MINOR_VERSION ()

/* Version number of GHC. */ #define GLASGOW_HASKELL 608

/* Allow code to be compiled differently for different versions of GTK+ */ #define GTK_CHECK_VERSION(major,minor,micro) \

(_GTK_MAJOR_VERSION > (major) \

(_GTK_MAJOR_VERSION == (major) && _GTK_MINOR_VERSION > (minor)) \ (_GTK_MAJOR_VERSION == (major) && _GTK_MINOR_VERSION == (minor) && \

_GTK_MICRO_VERSION >= (micro)))

/* Allow code to be compiled differently for different versions of Pango */ #define PANGO_CHECK_VERSION(major,minor,micro) \

(_PANGO_MAJOR_VERSION > (major) \

(_PANGO_MAJOR_VERSION == (major) && _PANGO_MINOR_VERSION > (minor)) \ (_PANGO_MAJOR_VERSION == (major) && _PANGO_MINOR_VERSION == (minor) && \

_PANGO_MICRO_VERSION >= (micro)))

/* Allow code to be compiled differently for different versions of Glib */ #define GLIB_CHECK_VERSION(major,minor,micro) \

(_GLIB_MAJOR_VERSION > (major) \

(_GLIB_MAJOR_VERSION == (major) && _GLIB_MINOR_VERSION > (minor)) \ (_GLIB_MAJOR_VERSION == (major) && _GLIB_MINOR_VERSION == (minor) && \

_GLIB_MICRO_VERSION >= (micro)))

/* Allow code to be compiled differently for different versions of Glib */ #define GSTREAMER_CHECK_VERSION(major,minor,micro) \

(_GSTREAMER_MAJOR_VERSION > (major) \

(_GSTREAMER_MAJOR_VERSION == (major) && _GSTREAMER_MINOR_VERSION > (minor)) \ (_GSTREAMER_MAJOR_VERSION == (major) && _GSTREAMER_MINOR_VERSION == (minor) && \

_GSTREAMER_MICRO_VERSION >= (micro)))

/* Allow code to be compiled differently for different versions of cairo */ #define CAIRO_CHECK_VERSION(major,minor,micro) \

(_CAIRO_MAJOR_VERSION > (major) \

(_CAIRO_MAJOR_VERSION == (major) && _CAIRO_MINOR_VERSION > (minor)) \ (_CAIRO_MAJOR_VERSION == (major) && _CAIRO_MINOR_VERSION == (minor) && \

_CAIRO_MICRO_VERSION >= (micro)))

  Changed 6 years ago by pgavin

  • status changed from new to closed
  • resolution set to fixed

Very old, I'm guessing we've fixed this.

Note: See TracTickets for help on using tickets.