[GRASS-dev] multiple definition of _fmode on Win32

Hi all,

I am trying to compile yesterday's CVS sources on Win32 using MSYS and
MingW (3.4.2).
When the make script should link the gis lib objs (and other libs), I
get this:

OBJ.i686-pc-mingw32/open_misc.o(.data+0x0): In function `G__open_misc':
C:/msys/src/grass6/lib/gis/open_misc.c:45: multiple definition of `_fmode'
OBJ.i686-pc-mingw32/open.o(.data+0x0):C:/msys/src/grass6/lib/gis/open.c:98:
first defined here
collect2: ld returned 1 exit status
make[2]: ***
[/src/grass6/dist.i686-pc-mingw32/lib/libgrass_gis.6.3.cvs.dll] Error 1

I updated from CVS ca. 18 hours ago and did a "make distclean" and "make
clean" before running the configure script.

Am I doing sth. wrong here?

Best,

Benjamin

--
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany

Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg

Benjamin Ducke wrote:

I am trying to compile yesterday's CVS sources on Win32 using MSYS and
MingW (3.4.2).
When the make script should link the gis lib objs (and other libs), I
get this:

OBJ.i686-pc-mingw32/open_misc.o(.data+0x0): In function `G__open_misc':
C:/msys/src/grass6/lib/gis/open_misc.c:45: multiple definition of `_fmode'
OBJ.i686-pc-mingw32/open.o(.data+0x0):C:/msys/src/grass6/lib/gis/open.c:98:
first defined here
collect2: ld returned 1 exit status
make[2]: ***
[/src/grass6/dist.i686-pc-mingw32/lib/libgrass_gis.6.3.cvs.dll] Error 1

I updated from CVS ca. 18 hours ago and did a "make distclean" and "make
clean" before running the configure script.

I've removed both occurrences of _fmode from libgis (in any case,
defining it inside a DLL doesn't work). _fmode should be defined by
linking against $(FMODE_OBJ).

--
Glynn Clements <glynn@gclements.plus.com>

Thanks, Glynn for the quick reply.
This fixed things in part. However, now I have a problem with the DBMI
lib:

cd /src/grass6/lib/db/dbmi_client
make

gives me:

gcc -I/src/grass6/dist.i686-pc-mingw32/include -I/include
-I/local/include -g -O2 -I/include -I/local/include
-DPACKAGE=\""grasslibs"\" -I../dbmi_base -DPACKAGE=\""grasslibs"\"
-I/src/grass6/dist.i686-pc-mingw32/include \
        -o OBJ.i686-pc-mingw32/start.o -c start.c
start.c: In function `db_start_driver':
start.c:157: error: `have_stdin' undeclared (first use in this function)
start.c:157: error: (Each undeclared identifier is reported only once
start.c:157: error: for each function it appears in.)
start.c:157: error: `have_stdout' undeclared (first use in this function)
start.c:162: error: `stdin_fd' undeclared (first use in this function)
start.c:168: error: `stdin_orig' undeclared (first use in this function)
start.c:185: error: `stdout_fd' undeclared (first use in this function)
start.c:191: error: `stdout_orig' undeclared (first use in this function)
make[1]: *** [OBJ.i686-pc-mingw32/start.o] Error 1
make[1]: Leaving directory `/src/grass6/lib/db/dbmi_client'

Maybe something needs to be fixed in the configure script for Win32?

Thanks,

Benjamin

Glynn Clements wrote:

Benjamin Ducke wrote:

I am trying to compile yesterday's CVS sources on Win32 using MSYS and
MingW (3.4.2).
When the make script should link the gis lib objs (and other libs), I
get this:

OBJ.i686-pc-mingw32/open_misc.o(.data+0x0): In function `G__open_misc':
C:/msys/src/grass6/lib/gis/open_misc.c:45: multiple definition of `_fmode'
OBJ.i686-pc-mingw32/open.o(.data+0x0):C:/msys/src/grass6/lib/gis/open.c:98:
first defined here
collect2: ld returned 1 exit status
make[2]: ***
[/src/grass6/dist.i686-pc-mingw32/lib/libgrass_gis.6.3.cvs.dll] Error 1

I updated from CVS ca. 18 hours ago and did a "make distclean" and "make
clean" before running the configure script.

I've removed both occurrences of _fmode from libgis (in any case,
defining it inside a DLL doesn't work). _fmode should be defined by
linking against $(FMODE_OBJ).

--
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany

Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg

On 23/04/07 15:02, Benjamin Ducke wrote:

Thanks, Glynn for the quick reply.
This fixed things in part. However, now I have a problem with the DBMI
lib:

cd /src/grass6/lib/db/dbmi_client
make

gives me:

gcc -I/src/grass6/dist.i686-pc-mingw32/include -I/include
-I/local/include -g -O2 -I/include -I/local/include
-DPACKAGE=\""grasslibs"\" -I../dbmi_base -DPACKAGE=\""grasslibs"\"
-I/src/grass6/dist.i686-pc-mingw32/include \
        -o OBJ.i686-pc-mingw32/start.o -c start.c
start.c: In function `db_start_driver':
start.c:157: error: `have_stdin' undeclared (first use in this function)
start.c:157: error: (Each undeclared identifier is reported only once
start.c:157: error: for each function it appears in.)
start.c:157: error: `have_stdout' undeclared (first use in this function)
start.c:162: error: `stdin_fd' undeclared (first use in this function)
start.c:168: error: `stdin_orig' undeclared (first use in this function)
start.c:185: error: `stdout_fd' undeclared (first use in this function)
start.c:191: error: `stdout_orig' undeclared (first use in this function)
make[1]: *** [OBJ.i686-pc-mingw32/start.o] Error 1
make[1]: Leaving directory `/src/grass6/lib/db/dbmi_client'

Maybe something needs to be fixed in the configure script for Win32?

This seems to come from Brad's latest change to start.c:

@@ -33,9 +38,6 @@
      int stat;
      dbConnection connection;
      char ebuf[5];
- int stdin_orig, stdout_orig;
- int have_stdin, have_stdout;
- int stdin_fd, stdout_fd;

Brad, any special reason for this, or did you just not see that these are used in the #ifdef __MINGW32__ which starts at line 117 ?

Moritz

Moritz Lennert wrote:

> This fixed things in part. However, now I have a problem with the DBMI
> lib:
>
> cd /src/grass6/lib/db/dbmi_client
> make
>
> gives me:
>
> gcc -I/src/grass6/dist.i686-pc-mingw32/include -I/include
> -I/local/include -g -O2 -I/include -I/local/include
> -DPACKAGE=\""grasslibs"\" -I../dbmi_base -DPACKAGE=\""grasslibs"\"
> -I/src/grass6/dist.i686-pc-mingw32/include \
> -o OBJ.i686-pc-mingw32/start.o -c start.c
> start.c: In function `db_start_driver':
> start.c:157: error: `have_stdin' undeclared (first use in this function)
> start.c:157: error: (Each undeclared identifier is reported only once
> start.c:157: error: for each function it appears in.)
> start.c:157: error: `have_stdout' undeclared (first use in this function)
> start.c:162: error: `stdin_fd' undeclared (first use in this function)
> start.c:168: error: `stdin_orig' undeclared (first use in this function)
> start.c:185: error: `stdout_fd' undeclared (first use in this function)
> start.c:191: error: `stdout_orig' undeclared (first use in this function)
> make[1]: *** [OBJ.i686-pc-mingw32/start.o] Error 1
> make[1]: Leaving directory `/src/grass6/lib/db/dbmi_client'
>
>
> Maybe something needs to be fixed in the configure script for Win32?

This seems to come from Brad's latest change to start.c:

@@ -33,9 +38,6 @@
      int stat;
      dbConnection connection;
      char ebuf[5];
- int stdin_orig, stdout_orig;
- int have_stdin, have_stdout;
- int stdin_fd, stdout_fd;

Brad, any special reason for this, or did you just not see that these
are used in the #ifdef __MINGW32__ which starts at line 117 ?

Almost certainly the latter. I've restored the variables,
conditionalised upon "#ifdef __MINGW32__" to prevent "unused variable"
warnings on other platforms (which is probably the reason that they
were removed).

--
Glynn Clements <glynn@gclements.plus.com>

OK, this seems to have done the trick.
Thanks for the quick help.

In the future, I will try to find more time to compile and test the CVS
version of GRASS more frequently on Win32, so problems like these will
surface early.

Benjamin

Glynn Clements wrote:

Moritz Lennert wrote:

This fixed things in part. However, now I have a problem with the DBMI
lib:

cd /src/grass6/lib/db/dbmi_client
make

gives me:

gcc -I/src/grass6/dist.i686-pc-mingw32/include -I/include
-I/local/include -g -O2 -I/include -I/local/include
-DPACKAGE=\""grasslibs"\" -I../dbmi_base -DPACKAGE=\""grasslibs"\"
-I/src/grass6/dist.i686-pc-mingw32/include \
        -o OBJ.i686-pc-mingw32/start.o -c start.c
start.c: In function `db_start_driver':
start.c:157: error: `have_stdin' undeclared (first use in this function)
start.c:157: error: (Each undeclared identifier is reported only once
start.c:157: error: for each function it appears in.)
start.c:157: error: `have_stdout' undeclared (first use in this function)
start.c:162: error: `stdin_fd' undeclared (first use in this function)
start.c:168: error: `stdin_orig' undeclared (first use in this function)
start.c:185: error: `stdout_fd' undeclared (first use in this function)
start.c:191: error: `stdout_orig' undeclared (first use in this function)
make[1]: *** [OBJ.i686-pc-mingw32/start.o] Error 1
make[1]: Leaving directory `/src/grass6/lib/db/dbmi_client'

Maybe something needs to be fixed in the configure script for Win32?

This seems to come from Brad's latest change to start.c:

@@ -33,9 +38,6 @@
      int stat;
      dbConnection connection;
      char ebuf[5];
- int stdin_orig, stdout_orig;
- int have_stdin, have_stdout;
- int stdin_fd, stdout_fd;

Brad, any special reason for this, or did you just not see that these
are used in the #ifdef __MINGW32__ which starts at line 117 ?

Almost certainly the latter. I've restored the variables,
conditionalised upon "#ifdef __MINGW32__" to prevent "unused variable"
warnings on other platforms (which is probably the reason that they
were removed).

--
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany

Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg