Subject: FVWM: unable to compile with gnome libs

From: Stephane Rosa <[email-masked]>
Date: Mon, 23 Jul 2001 12:23:03 +0200 (CEST)

Hi,

it sounds like I can't compile with gnome support. I found this out
when trying to configure fvwm, which tries to compile this
(in ./configure):

#line 5911 "configure"
#include "confdefs.h"

#include <gnome.h>
int main(int c, char **v) {
   /* we can't really run this outside of X */
   if (!c) gnome_init("test-app", "0.0", c, v);
      return 0;
}

and there is a conflict between stdio.h and gnomesupport.h which
redefines sprintf and vsnprintf as if they weren't part or standard
include files already :

configure:5921: sgifwcompile -e -q -nostdinc -I.
-I/d3/myroots/proot/usr/freeware/include -I/d3/myroots/proot/usr/include 
-D_BSD_SIGNALS -O3 -OPT:Olimit=0:space=ON -DEBUG:optimize_space=on  -TENV:X=1
-CG:unique_exit=on 
-OPT:IEEE_arithmetic=1:roundoff=0:wrap_around_unsafe_opt=off -n32 -mips3
-nostdlib -L/d3/myroots/proot/usr/freeware/lib32 
-L/d3/myroots/proot/usr/lib32 -woff
1009,1014,1107,1110,1116,1164,1185,1188,1204,1230,1233  -Wl,-woff,85,-woff,84
-rpath /usr/freeware/lib32 -- /d3/myroots/ptoolroot/usr/bin/cc -o conftest -g 
-I/d3/myroots/proot/usr/freeware/include -DNEED_GNOMESUPPORT_H
-I/d3/myroots/proot/usr/freeware/lib32/gnome-libs/include
-I/d3/myroots/proot/usr/freeware/include/glib-1.2
-I/d3/myroots/proot/usr/freeware/lib32/glib/include
-I/d3/myroots/proot/usr/freeware/include/gtk-1.2  conftest.c 
-L/d3/myroots/proot/usr/freeware/lib32 -lgnomeui -lart_lgpl -lgdk_imlib -lSM
-lICE -lgtk -lgdk -lgmodule -lXi -lXext -lX11 -lgnome -lgnomesupport -lesd
-laudio -laudiofile -lm -ldb -lglib 1>&5
cc-1143 cc: ERROR File = /d3/myroots/proot/usr/include/stdio.h, Line = 235
  Declaration is incompatible with "int snprintf(char *, size_t, char *, ...)"
          (declared at line 36 of
          "/d3/myroots/proot/usr/freeware/lib32/gnome-libs/include/gnomesupport
          .h").

  extern int    snprintf(char *, ssize_t, const char *, ...);
                ^

cc-1143 cc: ERROR File = /d3/myroots/proot/usr/include/stdio.h, Line = 244
  Declaration is incompatible with
          "int vsnprintf(char *, size_t, char *, va_list)" (declared at line
          34 of
          "/d3/myroots/proot/usr/freeware/lib32/gnome-libs/include/gnomesupport
          .h").

  extern int    vsnprintf(char *, ssize_t, const char *, /* va_list */ char *);
                ^

a more straightforward compile command gives the same result :

cc -I/d3/myroots/proot/usr/freeware/lib32/gnome-libs/include
-I/d3/myroots/proot/usr/freeware/include
-I/d3/myroots/proot/usr/freeware/include/gtk-1.2
-I/d3/myroots/proot/usr/freeware/include/glib-1.2
-I/d3/myroots/proot/usr/freeware/lib32/glib/include -o conftest -c conftest.c

Here are the offending prototypes :

stdio.h:
extern int  snprintf(char *, ssize_t, const char *, ...);
extern int  vsnprintf(char *, ssize_t, const char *, char *);

gnomesupport.h:
/* Maximum chars of output to write is MAXLEN.  */
int snprintf  (char *, size_t, char *, ...);
int vsnprintf (char *, size_t, char *, va_list);

just wanted to know if anybody already encountered such a
problem, cuz I have no clue where to look at in the first
place. Any ideas ? Why aren't they "extern" in gnomesupport ?
Can I just fix gnomesupport.h ( I guess not...)

Thanks!
Stephane

-- 
SILICON GRAPHICS                 EUROPEAN MANUFACTURING CENTER
##############################################################
Stephane Rosa                     Tel :     +41 (0)32 843-3638
Business Analyst                  Fax :     +41 (0)32 843-3909
APS/FP  Project                   GSM :     +41 (0)79 616-0828
--------------------------------------------------------------
ircnoc.neu.sgi.com  SGI Intranet  IRC :   EuroOper on #irchelp
irc.stealth.net     Euro-IRCNet   IRC :   Clipper on #radionet
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 23 Jul 2001 17:02:33 +0000

>    if (!c) gnome_init("test-app", "0.0", c, v);

Just to make it clear. This configure check is unique to FVWM, gnome.m4
does not contain it. I added it because a lot of users have a non-working
GNOME instalation, usually an incorrect gnome-config or header files.
gnome.m4 does not detect this, like in your situation, so I enhanced it.

The GNOME libs support (not to be confused with GNOME WM hints) is only
used in FvwmGtk module and is fully optional. It only determines whether
FvwmGtk is a gtk application or a gnome application. It is almost safe to
say that you will not lose anything without "GNOME support in FvwmGtk".
For example, our rpms have no such support not to be dependent on GNOME.

> redefines sprintf and vsnprintf as if they weren't part or standard

[skipped]

> Can I just fix gnomesupport.h ( I guess not...)

Sorry, I am not a GNOME developer.
I would like to know if there is anything FVWM can help in this situation.

Regards,
Mikhael.