首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GEOS构建错误

GEOS构建错误
EN

Stack Overflow用户
提问于 2016-08-26 19:01:23
回答 2查看 222关注 0票数 1

在make.Have看到类似SE查询MinGW / CxxTest bizarre errors的过程中,GEOS库geos-3.5.0.tar.bz2失败,但我不确定要更改哪个文件,因为命令在配置文件和makefile中。

代码语言:javascript
复制
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../include -I../../../include/geos  -I../../../include   -DGEOS_INLINE  -pedantic -Wall -ansi -Wno-long-long  -ffloat-store -g -O2 -MT IndexedPointInAreaLocator.lo -MD -MP -MF .deps/IndexedPointInAreaLocator.Tpo -c -o IndexedPointInAreaLocator.lo IndexedPointInAreaLocator.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../include -I../../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -g -O2 -MT IndexedPointInAreaLocator.lo -MD -MP -MF .deps/IndexedPointInAreaLocator.Tpo -c IndexedPointInAreaLocator.cpp -o IndexedPointInAreaLocator.o
In file included from c:\mingw\include\wchar.h:208:0,
                 from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\cwchar:44,
                 from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\bits\postypes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\bits\char_traits.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.9.3\include\c++\string:40,
                 from ../../../include/geos/geom/Coordinate.h:24,
                 from ../../../include/geos/geom/Envelope.h:25,
                 from ../../../include/geos/geom/Geometry.h:27,
                 from IndexedPointInAreaLocator.cpp:17:
c:\mingw\include\sys/stat.h:173:14: error: '_dev_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
              ^
c:\mingw\include\sys/stat.h:173:14: error: '_ino_t' does not name a type
 struct _stat __struct_stat_defined( _off_t, time_t );
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-01 17:57:43

我采用的解决方案是根据G++ updated on MingW gets massive error messages的SE建议更改Makefile中的CXXFLAGS。

已在Makefile中搜索CXXFLAGS,如下所示

代码语言:javascript
复制
CXXFLAGS = -g -O2

我把它改成

代码语言:javascript
复制
CXXFLAGS = -g -O2 -std=gnu++11 -c -Wall 

由于子文件夹中有数十个Makefile,因此我使用python批处理脚本一次性更改了它们。

代码语言:javascript
复制
import os, fnmatch
def findReplace(directory, find, replace, filePattern):
    for path, dirs, files in os.walk(os.path.abspath(directory)):
        for filename in fnmatch.filter(files, filePattern):
            filepath = os.path.join(path, filename)
            with open(filepath) as f:
                s = f.read()
            s = s.replace(find, replace)
            with open(filepath, "w") as f:
                f.write(s)

findReplace(r"C:\MinGW\git_rep\geos-3.5.0", "CXXFLAGS = -g -O2", "CXXFLAGS = -g -O2 -std=gnu++11 -c -Wall", "Makefile") 
票数 0
EN

Stack Overflow用户

发布于 2016-09-01 17:12:55

我用MinGW-x64 https://sourceforge.net/projects/mingw-w64解决了我在x64系统上的问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39164758

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档