Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#273 closed defect (fixed)

trunk build failed with MinGW

Reported by: sanak Owned by: strk
Priority: major Milestone: 3.2.0
Component: Build/Install Version: master
Severity: Unassigned Keywords: mingw
Cc: ragi@…

Description (last modified by mloskot)

I had tried to build trunk source with MinGW at this weekend, and some error occurred.

  1. 'finite' function is not defined in MinGW
/// error message ///
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../source/headers -I../../../source/headers/geos -I../../../source/headers -g -O2 -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -MT IndexedPointInAreaLocator.lo -MD -MP -MF .deps/IndexedPointInAreaLocator.Tpo -c IndexedPointInAreaLocator.cpp  -DDLL_EXPORT -DPIC -o .libs/IndexedPointInAreaLocator.o
In file included from ../../../source/headers/geos/geom/Geometry.h:26,
                 from IndexedPointInAreaLocator.cpp:18:
../../../source/headers/geos/platform.h: In function `bool isFinite(double)':
../../../source/headers/geos/platform.h:64: error: `finite' was not declared in this scope
../../../source/headers/geos/platform.h:64: warning: unused variable 'finite'
make[4]: *** [IndexedPointInAreaLocator.lo] Error 1

I had modified source/headers/geos/platform.h.in(see attached patch), but I don't know that my modification is the valid way, so please check my patch carefully. The following topic may be relate to this problem. http://lists.osgeo.org/pipermail/geos-devel/2006-June/002350.html

2.dllimport error

/// error message ///
HCoordinate.cpp:233: warning: non-inline function 'void geos::algorithm::HCoordinate::getCoordinate(geos::geom::Coordinate&) const' is defined after prior declaration as dllimport: attribute ignored
HCoordinate.cpp:233: warning: 'void geos::algorithm::HCoordinate::getCoordinate(geos::geom::Coordinate&) const' defined locally after being referenced with dllimport linkage
HCoordinate.cpp: In constructor `geos::algorithm::HCoordinate::HCoordinate(const geos::geom::Coordinate&)':
HCoordinate.cpp:130: internal compiler error: in rest_of_handle_final, at toplev.c:2067

I had modified source/headers/geos/export.h(see attached patch). I think that if no preprocessor definition (like GEOS_DLL_XXX), GEOS_DLL should be defined as null word, but I hope someone check this.

NOTICE I had set MinGW environment referring to the following site, http://trac.osgeo.org/postgis/wiki/UsersWikiWinCompile and, modify some files.

  • MinGW(g++-3.4.5)
    \MinGW\include\c++\3.4.5\cwchar
    ...comment out import (v)swprintf.
    
  using ::putwchar;
  //using ::swprintf; // delete
  using ::swscanf;
  using ::ungetwc;
  using ::vfwprintf;
#if _GLIBCXX_HAVE_VFWSCANF
  using ::vfwscanf;
#endif
  //using ::vswprintf; // delete
#if _GLIBCXX_HAVE_VSWSCANF
  using ::vswscanf;
#endif
  • libtool(2.2.4)
    \libltdl\config\ltmain.sh
    ... add include <process.h>
    
#ifdef _MSC_VER
# include <direct.h>
# include <process.h>
# include <io.h>
# define setmode _setmode
#else
# include <unistd.h>
# include <stdint.h>
# ifdef __CYGWIN__
#  include <io.h>
# endif
/* <-- add for _P_WAIT */
# ifdef __MINGW32__
#  include <process.h>
# endif
/* --> */
#endif

Regards,

Sanak.

Attachments (4)

fix-mingw.patch (1.3 KB) - added by sanak 9 years ago.
TortoiseSVN(Japanese)
fix-export+msvc90.patch (5.7 KB) - added by sanak 9 years ago.
TortoiseSVN(Double Byte Character Set)
fix-msvc90-only.patch (4.9 KB) - added by sanak 9 years ago.
TortoiseSVN(modify DBCS to ASCII)
fix-msvc90-only2.patch (4.9 KB) - added by sanak 9 years ago.
Ubuntu 9.0.4 NBR svn diff(Japanese)

Download all attachments as: .zip

Change History (21)

Changed 9 years ago by sanak

Attachment: fix-mingw.patch added

TortoiseSVN(Japanese)

comment:1 Changed 9 years ago by pramsey

Owner: changed from pramsey to strk

comment:2 Changed 9 years ago by strk

Cc: ragi@… added

Ragi, could you check this patch doesn't break your MSVC builds please ?

comment:3 Changed 9 years ago by strk

On behalf of ragi:

If you are going to do the changes to the preprocessor definitions to be [GEOS_EXPORT and GEOS_IMPORT] instead of [GEOS_DLL_LIBRARY_STATIC and GEOS_DLL_LIBRARY], this does make sense to me from a naming convention point of view. However, the Visual Studio studio project's preprocessor section needs to also be changed or the symbols will not be exported.

Sanak, can you provide another patch for the VS project too, or keep the old naming ?

Anyone with more trac knowledge: how to give ragi "append" privileges here ?

comment:4 in reply to:  3 Changed 9 years ago by sanak

strk, Ragi,

Thanks for your reply. I will create another patch for the VS project at this weekend.

Changed 9 years ago by sanak

Attachment: fix-export+msvc90.patch added

TortoiseSVN(Double Byte Character Set)

comment:5 in reply to:  3 ; Changed 9 years ago by sanak

strk, Ragi

I had created the patch for the VS2009 project, but another treatments will be necessary for VS2008(#268) and Makefile.vc by this patch.

So I will create new ticket for Makefile.vc problem, and modify #268 ticket later.

I wish GEOS supported cmake build system like QGis..

Regards,

comment:6 Changed 9 years ago by strk

So, to recap: should I apply both fix-mingw.patch AND fix-export+msvc90.patch against current trunk (r2607) and then wait for a new patch on #268 ?

comment:7 in reply to:  6 Changed 9 years ago by sanak

strk,

Yes.

Current trunk(r2607) windows build results are as follows.

msvc90msvc80nmakemingw
ox(#268)xx(#273)

(x:dllimport error .etc)

After you apply above patches, the results will change as follows.

msvc90msvc80nmakemingw
ox(#268)x(*1)o

(x(#268):sync problem, x(*1):dllexport for geos_c.dll)

I will create new patch for msvc80(#268), and create new ticket for nmake(Makefile.vc) build problem, after that.

comment:8 Changed 9 years ago by strk

I committed the fix-mingw.patch but fix-export+msvc90.patch didn't apply cleanly. Could you try to reproduce the latter against r2608 please (could be the multi-byte format maybe?).

Changed 9 years ago by sanak

Attachment: fix-msvc90-only.patch added

TortoiseSVN(modify DBCS to ASCII)

comment:9 Changed 9 years ago by sanak

strk,

Ok, I had attached the new patch(fix-msvc90-only.patch).

comment:10 Changed 9 years ago by strk

Keeps failing, no idea why:

(Stripping trailing CRs from patch.) patching file build/msvc90/geos_c_dll/geos_c_dll.vcproj Hunk #1 FAILED at 42. Hunk #2 FAILED at 119. 2 out of 2 hunks FAILED -- saving rejects to file build/msvc90/geos_c_dll/geos_c_dll.vcproj.rej (Stripping trailing CRs from patch.) patching file build/msvc90/geos_lib/geos_lib.vcproj Hunk #1 FAILED at 42. Hunk #2 FAILED at 109. Hunk #3 FAILED at 1601. 3 out of 3 hunks FAILED -- saving rejects to file build/msvc90/geos_lib/geos_lib.vcproj.rej (Stripping trailing CRs from patch.) patching file build/msvc90/geos_unit/geos_unit.vcproj Hunk #1 FAILED at 42. Hunk #2 FAILED at 121. Hunk #3 FAILED at 510. Hunk #4 FAILED at 562. Hunk #5 FAILED at 586. 5 out of 5 hunks FAILED -- saving rejects to file build/msvc90/geos_unit/geos_unit.vcproj.rej

Changed 9 years ago by sanak

Attachment: fix-msvc90-only2.patch added

Ubuntu 9.0.4 NBR svn diff(Japanese)

comment:11 in reply to:  10 Changed 9 years ago by sanak

strk,

Sorry, I don't know why it fails. I had recreated the patch(fix-msvc90-only2.patch) by Ubuntu svn diff command, so please try this file.

Regards,

Keeps failing, no idea why:

comment:12 Changed 9 years ago by strk

Ok, fix-msvc90-only2.patch applied cleanly and was committed in r2609. Let me know if all is fine for this bug so I'll close and we can move to #268 for the rest.

comment:13 in reply to:  12 Changed 9 years ago by sanak

strk,

The build results are as follows.
mingw => ok (build only.(except "make check"))
msvc90 => ok

So, I think this ticket can be closed.

Regards,

comment:14 Changed 9 years ago by strk

Resolution: fixed
Status: newclosed

comment:15 in reply to:  5 ; Changed 8 years ago by mloskot

Replying to sanak:

I wish GEOS supported cmake build system like QGis..

If you're still interested, please take a look at ticket #317 - feedback, testing and improvements are strongly welcome. Note, I'm going to remove manually maintained Visual Studio projects as soon as I'm happy with the CMake configuration, very likely for milestone:3.3.0

...who's next to CMake'ing, PostGIS? :-P

comment:16 Changed 8 years ago by mloskot

Description: modified (diff)

comment:17 in reply to:  15 Changed 8 years ago by geosanak

Replying to mloskot:

I wish GEOS supported cmake build system like QGis..

If you're still interested, please take a look at ticket #317 - feedback, testing and improvements are strongly welcome. Note, I'm going to remove manually maintained Visual Studio projects as soon as I'm happy with the CMake configuration, very likely for milestone:3.3.0

Mateusz,

Thanks for your great work!
I will try this new build system at this weekend.

Regards,

Note: See TracTickets for help on using tickets.