|
From: Moloko V. <all...@gm...> - 2006-06-15 16:10:49
|
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. So, if the version of the compiler used doesn't offer this flexibilization to search later the declaration of the variable, so there will be a error. This isn't a compiler error, only a "flexibilization" that should be present or not. 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. The solution for this is to declare a header that will contain the globals to the backend.c implementation or, more commonly, declare the variable mdb_backends as "extern" in each source where it will be used. > > > The problem is with the static variable "GHashTable *mdb_backends' > > found in the files: > > - include/mdbtools.h > > - src/libmdb/backend.c > > I've ported this static variable to the header mdbtools.h and > > declared it as extern in backend.c. > > Declaring this in a header doesn't seem like the right thing to do, > to me at least. What's the error you get? > > Hmm, in fact, wasn't gcc 4.0.0 blacklisted in many toolchains for > being buggy? I'm pretty sure it was in KDE. > And I particularly remember Fedora shipping buggy compilers (and > patched with unofficial patches) on more than one occasion. :o( > > Perhaps it's a better idea to try a different compiler version? > > Martin > -- _______________________________ Allann J. O. Silva "I received the fundamentals of my education in school, but that was not enough. My real education, the superstructure, the details, the true architecture, I got out of the public library. For an impoverished child whose family could not afford to buy books, the library was the open door to wonder and achievement, and I can never be sufficiently grateful that I had the wit to charge through that door and make the most of it." (from I. Asimov, 1994) |