之前为了使用一个库,都是去下载源码,然后根据开发者提供的README手动用GCC编译,一直不能使用Makefile感觉很蛋痛,比如最近使用的ZThread

还是怪自己以前过于依赖IDE

最近发现用Cygwin就可以使用诸如./configure, make这样的命令,感觉灰常欣喜,尝试去编译ZThread库(因为我发现虽然之前我用GCC手动编译了ZThread但是在使用的过程中,ZThread总是往控制台上打印诸多的DEBUG信息,想必是编译选项的问题,我又不知道到哪个头文件中去找#define DEBUG,所以就想使用make,看使用ZThread作者写的configuration文件以及Makefile来编译能不能解决问题)

刚刚下载下来Cygwin就等着上去configure+make呢,问题就来了,输入./configure之后,等了一段时间报错(见红色文字):

$ ./configure
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
Loading m4 macros from share
checking for g++... g++
checking for C++ compiler default output file name... a.exe
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking pthread.h usability... no
checking pthread.h presence... no
checking for pthread.h... no
checking for sched_get_priority_max in -lrt... no
checking for sched_yield... no
checking for pthread_yield... no
checking for pthread_key_create... no
checking for pthread_keycreate... no
checking for doxygen... no
detecting for ftime() function
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for _ftime()... yes
checking how to run the C++ preprocessor... g++ -E
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for target implementation... compile-time guess
checking for sigsetjmp()... no
checking for _beginthreadex()... no
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by gcc... d:/mingw/mingw32/bin/ld.exe
checking if the linker (d:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for d:/mingw/mingw32/bin/ld.exe option to reload object files... -r
checking for BSD-compatible nm... /cygdrive/d/MinGW/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking dlfcn.h usability... no
checking dlfcn.h presence... no
checking for dlfcn.h... no
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 8192
checking command to parse /cygdrive/d/MinGW/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for correct ltmain.sh version... grep: character class syntax is [[:space:]], not [:space:]
no *** Gentoo sanity check failed! ***
*** libtool.m4 and ltmain.sh have a version mismatch! ***
*** (libtool.m4 = 1.5.10, ltmain.sh = ) *** Please run: libtoolize --copy --force if appropriate, please contact the maintainer of this
package (or your distribution) for help.

输入:libtoolize --copy --force提示libtoolize: command not found

咋办?搜了一下相关的问题,原来是因为安装Cygwin的时候没有安装libtool

重新运行Cygwin-setup(注意,无需卸载,重新运行setup,选择你没有安装的package即可),搜索libtool,勾选并安装,问题解决

然后再次运行libtoolize --copy --force,又报错:

$ libtoolize --copy --force
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize: `/usr/share/aclocal/libtool.m4'
libtoolize: `/usr/share/aclocal/ltoptions.m4'
libtoolize: `/usr/share/aclocal/ltversion.m4'
libtoolize: `/usr/share/aclocal/ltsugar.m4'
libtoolize: `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

又搜了一下,在这篇BLOG说是因为没安装autoconf的原因,再回去安装autoconf,如图

再试一次libtoolize --copy --force

结果还是报同样的错误,回头去看(上面有图,就是libtool那张)原来是libtool-debuginfo和cygwin64-libtool没有安装

于是安装libtool-debuginfo和cygwin64-libtool

再试一次libtoolize --copy --force,成功运行

好了,继续:./configure --prefix D:/ZThread/bin #--prefix指定编译时输出二进制文件的目录

然后还是报错,又运行libtoolize --copy --force,还是报错,无语了

然后,上网搜了半天,在这里找到提示说使用:autoreconf --force --install --symlink

然后又报错Can't exec "aclocal"

继续搜,在这里找到提示说要安装automake(然后我就去Cygwin-setup安装了automake-1.8,注意不要重复安装多个版本,否则会出问题)

然后输入make install又提示make: command not found

还是同样的套路,把make package给勾选安装就行了

【待完善】make: command not found,以及libtool.m4 and ltmain.sh have a version mismatch问题的解决方案的更多相关文章

  1. libtool: Version mismatch error 解决

    在编译一个软件的时候,在 ./configure 和 make  之后可能会出现如下错误: libtool: Version mismatch error.  This is libtool 2.4. ...

  2. libtool: Version mismatch error. 解决方法

    在编译一个软件的时候,在 ./configure 和 make  之后可能会出现如下错误: libtool: Version mismatch error.  This is libtool 2.4. ...

  3. ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory

    命令: ansible -i hosts_20 st  -m shell -a 'service zabbix_agentd star'  -K --become ansible -i hosts_2 ...

  4. Command 'ifconfig' not found, but can be installed with: sudo apt install net-tools VM Ubuntu 解决方案

    VMware下安装的Ubuntu 一开始由于Firefox连不上网,然后通过看了https://www.bbsmax.com/A/VGzlEGYJbq/这个文章之后,自己也测了一下,确实好用 但是if ...

  5. mooon模板的automake、autoconf、m4和libtool版本信息

    autoconf --version autoconf (GNU Autoconf) 2.59 automake --version automake (GNU automake) 1.9.6 m4 ...

  6. GET command找不到

    谷歌的: On running a cronjob with get command, I was getting the following error. /bin/sh: GET: command ...

  7. Reprint: ADB is Not Recognized as an internal or external command Fix

    ADB: Android Debug Bridge http://zacktutorials.blogspot.hk/2013/04/adb-is-not-recognized-as-internal ...

  8. arcmap Command

    The information in this document is useful if you are trying to programmatically find a built-in com ...

  9. 如何将 Cortana 与 Windows Phone 8.1 应用集成 ( Voice command - Natural language recognition )

    随着 Windows Phone 8.1 GDR1 + Cortana 中文版的发布,相信有很多用户或开发者都在调戏 Windows Phone 的语音私人助理 Cortana 吧,在世界杯的时候我亲 ...

随机推荐

  1. 客户端的javascript改变了asp.net webform页面控件的值,后台代码中如何获取修改后的值。

    客户端的javascript改变了asp.net webform页面控件的值,后台代码中如何获取修改后的值.     无论是什么的html控件,只要加上了runat="server" ...

  2. 将具有特殊class名img标签替换成[img][/img]标签--javascript正则表达式实践

    在项目中,可能有时候需要将一些特殊的东西加一个特别的属性,或者一个特殊的Class.如下: <!-- 第一种写法 --> <img src="abc.jpg" f ...

  3. Windows最常用的8个网络CMD命令总结

    一,ping 它是用来检查网络是否通畅或者网络连接速度的命令.作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握的DOS命令,它所利用的原理是这样的:网络上的机器都有唯一确定的IP ...

  4. iOS 使用腾讯地图显示用户位置注意事项

    1. 向 target中info 加入  NSLocationWhenInUseUsageDescription,string 类型.值是描写叙述为什么须要用户位置,这句话会出如今 提示用户是否同意a ...

  5. activemq两种实现方式

    第一种:点对点 #发布者public class Producer { private static final String userName = ActiveMQXAConnectionFacto ...

  6. 倍福TwinCAT(贝福Beckhoff)常见问题(FAQ)-如何修改代码字体

    工具-选项   TwinCAT,PLC Environment,Text editor,然后在文本区域中修改字体     更多教学视频和资料下载,欢迎关注以下信息: 我的优酷空间: http://i. ...

  7. Eclipse中,快捷键使用总结

    (1)Alt+shift+L:new ReadItem().readItems(file);的返回对象是Map<String,String>用这个快捷键有两个效果示例1:输入光标停在new ...

  8. Linux打包解压

    tar tar命令可以用来压缩打包单文件.多个文件.单个目录.多个目录. 常用格式: 单个文件压缩打包: tar czvf my.tar file1 多个文件压缩打包: tar czvf my.tar ...

  9. 改动Dialog窗口的类名

     VS2013 的MFC project(project名: MobileLink).想要改动窗口的类名时,发现不是像设置窗口名一样调用一个函数能够实现的. 实现的注意问题,请看凝视. (1) 改 ...

  10. 关于iOS上使用WWW引起的内存泄漏的临时解决方案

    原地址:http://www.unity蛮牛.com/thread-16493-1-1.html 目前,在的4.3.3.和4.3.4版本中存在一个iOS平台上的内存泄漏问题,即当使用WWW来下载和加载 ...