|
From: Martin E. <m.a...@nc...> - 2006-06-15 20:04:35
|
On Thursday 15 June 2006 17:10, Moloko Vellocet wrote: > The problem is that the static variable `mdb_backends' will be declared > only in the backend.c file, but the mdbtools.h header calls the variable > (like extern) before the compilation of the backend.c file. I have no idea what you mean by "calls the variable". Functions are called, not variables. Perhaps you mean "declares" or "defines" but - looking at the code - neither of those make sense either. > The common action to the gcc compiler is to declare the variable (called as > "extern") if the variable isn't currently declared, so gcc, will present a > compilation error. That's what happens on line 150 of mdbtools.h in pre1: /* hash to store registered backends */ extern GHashTable *mdb_backends; > The solution for this is to declare a header that will contain the globals > to the backend.c implementation or That's a really ugly solution. > , more commonly, declare the variable > mdb_backends as "extern" in each source where it will be used. That's what happens on line 150, as above. Looks like that compiler jsn't able to deal with a variable declared using 'extern', later being defined in the same compilation unit. I reiterate, the compiler you are using is known to be very buggy. That's not surprising really, x.0.0 releases of a lot of software tends to have the most glaring bugs. You still haven't said what error you get. I suggest you both a more recent compiler and a more recent version of mdbtools - particularly, mdbtools has improved a lot since 0.6pre1, which was released two years ago. Martin |