在msys32下编译mbsystem-5.4.2209

在msys32下编译mbsystem-5.4.2209

mbsystem需要gmt,请看博文msys2(msys2-i686-20180531)32位下安装GMT4.5.6 ,

解压mbsystem,然后configure

不使用外部proj和gsf

./configure mingw32 shared \

--prefix=/home/xiaok/mbsystem/mbsystem-5.4.2209 \

--bindir=/home/xiaok/mbsystem/mbsystem-5.4.2209/bin \

--libdir=/home/xiaok/mbsystem/mbsystem-5.4.2209/lib \

--includedir=/home/xiaok/mbsystem/mbsystem-5.4.2209/include \

--with-netcdf-lib=/mingw32/lib \

--with-netcdf-include=/mingw32/include \

--with-gmt-lib=/home/xiaok/gmt/GMT4.5.6/lib \

--with-gmt-include=/home/xiaok/gmt/GMT4.5.6/include \

--with-fftw-lib=/mingw32/lib \

--with-fftw-include=/mingw32/include \

--with-opengl-lib=/mingw32/i686-w64-mingw32/lib \

--with-opengl-include=/mingw32/i686-w64-mingw32/include \

--enable-bundledproj

然后make,报错:


/bin/sh ../../libtool  --tag=CC   --mode=link gcc -I/mingw32/include -g -O2  -L/usr/lib -L/mingw32/lib -L/home/xiaok/gmt/GMT4.5.6/lib -o mbotps.exe mbotps.o   ../../src/mbio/libmbio.la -L/home/xiaok/gmt/GMT4.5.6/lib -lgmt -lgmtps -lpsl -L/mingw32/lib -lnetcdf -lhdf5_hl -lhdf5 -lszip -lcurl -L/mingw32/lib -lproj -lm

libtool: link: gcc -I/mingw32/include -g -O2 -o .libs/mbotps.exe mbotps.o  -L/usr/lib -L/mingw32/lib -L/home/xiaok/gmt/GMT4.5.6/lib ../../src/mbio/.libs/libmbio.a /home/xiaok/mbsystem/mbsystem-5.4.2209/src/bsio/.libs/libmbbsio.a /home/xiaok/mbsystem/mbsystem-5.4.2209/src/surf/.libs/libmbsapi.a /home/xiaok/mbsystem/mbsystem-5.4.2209/src/gsf/.libs/libmbgsf.a -lws2_32 -llibtirpc -lgmt -lgmtps -lpsl -lnetcdf -lhdf5_hl -lhdf5 -lszip -lcurl -lproj

./.libs/lt-mbotps.c: In function 'main':

./.libs/lt-mbotps.c:315:10: warning: implicit declaration of function '_spawnv' [-Wimplicit-function-declaration]

   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);

          ^~~~~~~

./.libs/lt-mbotps.c:315:19: error: '_P_WAIT' undeclared (first use in this function); did you mean '__VALIST'?

   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);

                   ^~~~~~~

                   __VALIST

./.libs/lt-mbotps.c:315:19: note: each undeclared identifier is reported only once for each function it appears in

strip: './mbotps.exe': No such file

../../libtool: line 9500: ./mbotps.exe: No such file or directory

错误解决:


查看libtool文件,修改libtool

#ifdef _MSC_VER

# define _CRT_SECURE_NO_DEPRECATE 1

#endif

#include <stdio.h>

#include <stdlib.h>

# include <process.h>

#ifdef _MSC_VER

# include <direct.h>

# include <process.h>,删除掉,放在上面

# include <io.h>

#else

# include <unistd.h>

# include <stdint.h>

# ifdef __CYGWIN__

#  include <io.h>

# endif

#endif

#include <malloc.h>

#include <stdarg.h>

#include <assert.h>

#include <string.h>

#include <ctype.h>

#include <errno.h>

#include <fcntl.h>

#include <sys/stat.h>


make install,成功

以上内容转载自:xiaok海洋测绘网
分享到:
原文链接:,转发请注明来源!
「在msys32下编译mbsystem-5.4.2209」评论列表

发表评论