|
From: Moloko V. <all...@gm...> - 2006-05-18 15:54:15
|
Hi, I found a compilation problem with mdbtools-0.6pre1, I'm running:
Fedora Core 4
gcc-4.0.0
glibc 2.3.5
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 a=
s
extern in backend.c.
My correction:
diff -ruN mdbtools-0.6pre1/include/mdbtools.h mdbtools-0.6pre1-ajos
/include/mdbtools.h
--- mdbtools-0.6pre1/include/mdbtools.h 2004-06-16 19:42:19.000000000 -0400
+++ mdbtools-0.6pre1-ajos/include/mdbtools.h 2006-05-18 11:41:
31.000000000 -0400
@@ -147,7 +147,7 @@
#define IS_JET3(mdb) (mdb->f->jet_version=3D=3DMDB_VER_JET3)
/* hash to store registered backends */
-extern GHashTable *mdb_backends;
+static GHashTable *mdb_backends;
/* forward declarations */
typedef struct mdbindex MdbIndex;
diff -ruN mdbtools-0.6pre1/include/mdbver.h mdbtools-0.6pre1-ajos
/include/mdbver.h
--- mdbtools-0.6pre1/include/mdbver.h 2004-06-18 05:35:02.000000000 -0400
+++ mdbtools-0.6pre1-ajos/include/mdbver.h 1969-12-31 20:00:
00.000000000 -0400
@@ -1,26 +0,0 @@
-/* MDB Tools - A library for reading MS Access database files
- * Copyright (C) 2000 Brian Bruns
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _mdbver_h_
-#define _mdbver_h_
-
-#define MDB_FULL_VERSION "mdbtools v0.6pre1"
-#define MDB_VERSION_NO "0.6pre1"
-
-#endif
diff -ruN mdbtools-0.6pre1/src/libmdb/backend.c mdbtools-0.6pre1-ajos
/src/libmdb/backend.c
--- mdbtools-0.6pre1/src/libmdb/backend.c 2004-06-11 09:56:
41.000000000 -0400
+++ mdbtools-0.6pre1-ajos/src/libmdb/backend.c 2006-05-18 11:42:
09.000000000 -0400
@@ -28,7 +28,7 @@
#endif
static int is_init;
-static GHashTable *mdb_backends;
+extern GHashTable *mdb_backends;
/* Access data types */
static MdbBackendType mdb_access_types[] =3D {
--=20
_______________________________
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 t=
o
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)
|
|
From: Martin E. <m.a...@nc...> - 2006-05-18 16:34:22
|
On Thursday 18 May 2006 16:54, Moloko Vellocet wrote: > Hi, I found a compilation problem with mdbtools-0.6pre1, I'm > running: Fedora Core 4 > gcc-4.0.0 > glibc 2.3.5 > > 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 |
|
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) |
|
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 |
|
From: Sam M. <pa...@gm...> - 2006-06-16 20:01:43
|
On 16/06/06, Martin Ellis <m.a...@nc...> wrote a reply to the email > On Thursday 15 June 2006 17:10, Moloko Vellocet said stuff in. ... > 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. I would like to reiterate what Martin is saying. GCC 4.0.0 is known to cause a few interesting bugs and as such QEMU refuses to compile under it (GCC 4.x entirely I believe). I would suggest that if you can't go forwards, go back to GCC 3.3 - but I know personally I'm on 4.1.2 so 4.0.0 is rather far behind. Try upgrading to Fedora Core 5 and recompiling to see if you have the same difficulties. Sam > > Martin > > > _______________________________________________ > mdbtools-dev mailing list > mdb...@li... > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev > |
|
From: Simon N. <sna...@gm...> - 2006-06-17 12:37:44
|
This patch will allow you to build 0.6pre1 ON FC4 http://gdivelog.sourceforge.net/mdbtools-0.6pre1-build.patch On 6/17/06, Sam Moffatt <pa...@gm...> wrote: > On 16/06/06, Martin Ellis <m.a...@nc...> wrote a reply to the email > > On Thursday 15 June 2006 17:10, Moloko Vellocet said stuff in. > ... > > 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. > > I would like to reiterate what Martin is saying. GCC 4.0.0 is known to > cause a few interesting bugs and as such QEMU refuses to compile under > it (GCC 4.x entirely I believe). I would suggest that if you can't go > forwards, go back to GCC 3.3 - but I know personally I'm on 4.1.2 so > 4.0.0 is rather far behind. > > Try upgrading to Fedora Core 5 and recompiling to see if you have the > same difficulties. > > Sam > > > > > Martin > > > > > > _______________________________________________ > > mdbtools-dev mailing list > > mdb...@li... > > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev > > > > > _______________________________________________ > mdbtools-dev mailing list > mdb...@li... > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev > |