Re: strange problem




On Sat, 2005-01-22 at 14:45, Antonio Coralles wrote:
After switching to the GNU autotools a strange problem occured in my
program [this has at least something to do with GTKMM]:
In my program there are, as usual, two different ways to load a file.
You can pass a filename throgh argv or you can select a filename throgh
a Gtk::FileChooserDialog while the app is running. Now the strange thing
is, that when I load a file "throgh argv", so that the actual loading
happens before Gtk::Main::run(...) it perfectly works. But when I try to
load a file after the program has started I experience somekind of
undefined behavour. Sometimes the prog freezes and sometimes I get
strange segfaults - but not in the components of the interface, but deep
down in the routines which are responsible for loading. I eaven have a
test for loading/saving - and that test works fine. Besides I didn't get
this error before switching to automake. So my assumtion is that the
fault occurs at linking time - but I have no clue what it can be. I also
tried switching from -lboost_date_time to lboost_date_time_mt
[threadsave version] becuase it seems to me that Gtk is a multi threaded
library - but that doesn't really help. Maybe somebody here had similar
problems and knows what to do ...

Finally I solved this wired problem. I recognzed that the behavour of my buggy exectuable is seriously affected by the order in which the various *.a files are linked into my main executable. It also seems to me that moving the GTKMM linker flags before all other libraries had a positive effect. However, I started to experiment with the linking order - with the help of my handcrafted makefile - and soon this effort resulted in a working executable. Maybe this has something to do with static variables - which are this way initialized in the right order - but this is just a guess; Maybe someone can give me a more founded explanation why this did the magic ....
antonio



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