Re: compiling okay, success running gtk-app computer dependant





Tristan Van Berkom wrote:
On Fri, 26 Nov 2004 15:31:19 +0100, edward hage <edha xs4all nl> wrote:

Hello,

I have the strangest problem.

Recently I bought another computer and installed Linux Suse and by hand gtk-2.4.10 and the
whole bunch (glib, pango, etc...).


Hmmm, theres obviously something subtle that is "wrong" with your Suse
run time environment,
maybe your gtk compile/install went sour somewhere, maybe it can be nailed with
a backtrace ?



I found the problem. Well, I narrowed it down. Another gtk-program I had worked fine, so it could not be gtk itself.

I used ddd (for the first time) and it seems to be something with g_date_set_time.

I narrowed the problem down to this program. The following program shows a Segmetation Fault on one computer, and works fine for the other.


----------------------------------------
1: // name this program = time.c
2: #include <time.h>
3: #include <gtk/gtk.h>
4:
5: // compiled with: gcc -g time.c -o time `pkg-config gtk+-2.0 --cflags --libs`
6:
7: int main()
8: {
9:  struct tm tms;
10:  time_t current_time;
11:  GDate *date;
12:
13:  current_time = time (NULL);
14:
15:  tms = *localtime (&current_time);
16:  g_print("time is %d\n", time(NULL));
17:
18:  g_date_set_time (date, current_time);
19:  g_print("day = %d\n", date->day);
20:  return 0;
21: }
---------------------------------------

The problem does not appear when I do not define tms (blank line 9 and 15)!! But the problem is that in my 'real' program I want to use both tms and current_time.

The segmentation fault occurs after that the first line is printed. So this must be at g_date_set_time.

The big question is in my view: Is it a bug in glib / g_date_set_time that it can not deal with tms being defined or someting that is not okay with my computer?

The output of ddd:
Program received signal SIGSEGV, segmentation fault.
0x4045b16l in g_date_set_time (d=Variable "d" is not available) at gdate.c:858 in gdate.c


If anybody has some good suggestions I would like to hear them.
Thanks, edward




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]