【问题】
MingW环境下,已安装了gc-7.2,所以./configure是OK了,但是去make时,又出错了:
Administrator@NYBDHB7EB3XEHP6 /e/Dev_Tools/w3m/w3m-0.5.3 $ make (echo '#define DEFUN(x,y,z) x y';\ sed -ne '/^DEFUN/{p;n;/^[ ]/p;}' ./main.c ./menu.c) | gcc -E - | \ awk '$1 ~ /^[_A-Za-z]/ { \ for (i=2;i<=NF;i++) { print $i, $1} \ }' > funcname.tab.tmp funcname.tab updated sort funcname.tab | gawk -f ./funcname1.awk > funcname1.h gcc -I. -I. -g -O2 -I./libwc -I/usr/local/include -I/usr/local/include -DHAVE_CONFIG_H -DAUXBIN_DIR=\"/usr/local/libexe c/w3m\" -DCGIBIN_DIR=\"/usr/local/libexec/w3m/cgi-bin\" -DHELP_DIR=\"/usr/local/share/w3m\" -DETC_DIR=\"/usr/local/etc\" -DCONF_DIR=\"/usr/local/etc/w3m\" -DRC_DIR=\"~/.w3m\" -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -c -o main.o main.c main.c: In function 'main': main.c:836:23: error: void value not ignored as it ought to be main.c: In function 'getChar': main.c:2264:5: warning: passing argument 1 of 'wtf_parse1' from incompatible pointer type [enabled by default] ./libwc/wtf.h:71:19: note: expected 'wc_uchar **' but argument is of type 'char **' make: *** [main.o] Error 1
【解决过程】
1. 参考:
[SOLVED] Slackware64 -current: w3m fails to build…
去找到:
w3m fails to build with glibc-2.14 (x64) – ID: 3468040
下载到w3m-istream.diff,然后再参考自己之前写的:
先把w3m-istream.diff拷贝到w3m源码目录:
E:\Dev_Tools\w3m\w3m-0.5.3
下,然后看到w3m-istream.diff中的是:
diff -u w3m-0.5.3.org//istream.c w3m-0.5.3//istream.c
所以p后面应该是1,所以去执行patch命令:
Administrator@NYBDHB7EB3XEHP6 /e/Dev_Tools/w3m/w3m-0.5.3 $ patch -p1 < w3m-istream.diff patching file istream.c patching file istream.h
然后再去重新执行make,结果却是问题依旧。
2. 试了试make clean后再make,结果还是问题依旧。
3. 所以,算了,尝试着去换个其他版本的试试。
去下载w3m-0.5.2.tar.gz,然后解压,先./configure,再make,结果也是类似错误:
Administrator@NYBDHB7EB3XEHP6 /e/Dev_Tools/w3m/w3m-0.5.2 $ make (echo '#define DEFUN(x,y,z) x y';\ sed -ne '/^DEFUN/{p;n;/^[ ]/p;}' ./main.c ./menu.c) | gcc -E - | \ awk '$1 ~ /^[_A-Za-z]/ { \ for (i=2;i<=NF;i++) { print $i, $1} \ }' > funcname.tab.tmp funcname.tab updated sort funcname.tab | gawk -f ./funcname1.awk > funcname1.h gcc -I. -I. -g -O2 -I./libwc -I/usr/local/include -I/usr/local/include -DHAVE_CONFIG_H -DAUXBIN_DIR=\"/usr/local/libexe c/w3m\" -DCGIBIN_DIR=\"/usr/local/libexec/w3m/cgi-bin\" -DHELP_DIR=\"/usr/local/share/w3m\" -DETC_DIR=\"/usr/local/etc\" -DCONF_DIR=\"/usr/local/etc/w3m\" -DRC_DIR=\"~/.w3m\" -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -c -o main.o main.c main.c: In function 'main': main.c:845:23: error: void value not ignored as it ought to be make: *** [main.o] Error 1
然后就顺便去看了看源码:
275行: static GC_warn_proc orig_GC_warn_proc = NULL;
845行: orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
但是也还是看不太懂。
4. 不过倒是让我想起来,之前看README时,其中说如果要是在cygwin环境下编译此w3m时,则需要看
E:\Dev_Tools\w3m\w3m-0.5.2\doc\README.cygwin
的,因为此处mingw,也是和cygwin等类似的,所以应该有参考价值,所以,也应该需要好好看看人家的readme的。
但是看了半天,也看不太懂,没啥有效的启示。
5. 所以还是转回到w3m-0.5.3再看看吧。
参考:
[shlug]slackware下编译w3m报错(内含错误信息)
去试试,./configure –with-termlib="terminfo ncurses"
结果配置完毕后去make,错误依旧。
6. 后来参考:
去看了其解释,后来那人的解决办法是卸载boehmgc后重新安装boehmgc,就可以正常编译w3m了。
所以,此处,打算去对于上述的gc,也去卸载掉,然后重新安装最新的gc的版本,看看能否解决问题。
7.去gc中卸载:
Administrator@NYBDHB7EB3XEHP6 /e/Dev_Tools/gc/gc-7.2 $ make uninstall make[1]: Entering directory `/e/Dev_Tools/gc/gc-7.2' ( cd '/usr/local/share/gc' && rm -f barrett_diagram debugging.html gc.man gcdescr.html README README.amiga README.arm.c ross README.autoconf README.changes README.cmake README.contributors README.cords README.DGUX386 README.dj README.enviro nment README.ews4800 README.hp README.linux README.Mac README.MacOSX README.macros README.OS2 README.rs6000 README.sgi R EADME.solaris2 README.uts README.win32 README.win64 overview.html tree.html leak.html gcinterface.html scale.html README .darwin simple_example.html porting.html ) ( cd '/usr/local/include' && rm -f gc.h ) /bin/sh ./libtool --mode=uninstall rm -f '/usr/local/lib/libgc.la' libtool: uninstall: dldll=`/bin/sh 2>&1 -c '. /usr/local/lib/libgc.la; echo ../bin/libgc-1.dll'` libtool: uninstall: dlpath=/usr/local/lib/../bin/libgc-1.dll libtool: uninstall: rm -f /usr/local/lib/../bin/libgc-1.dll libtool: uninstall: rm -f /usr/local/lib/libgc.la /usr/local/lib/libgc.dll.a /usr/local/lib/libgc.a /bin/sh ./libtool --mode=uninstall rm -f '/usr/local/lib/libcord.la' libtool: uninstall: dldll=`/bin/sh 2>&1 -c '. /usr/local/lib/libcord.la; echo ../bin/libcord-1.dll'` libtool: uninstall: dlpath=/usr/local/lib/../bin/libcord-1.dll libtool: uninstall: rm -f /usr/local/lib/../bin/libcord-1.dll libtool: uninstall: rm -f /usr/local/lib/libcord.la /usr/local/lib/libcord.dll.a /usr/local/lib/libcord.a ( cd '/usr/local/lib/pkgconfig' && rm -f bdw-gc.pc ) ( cd '/usr/local/include/gc' && rm -f gc.h gc_typed.h gc_inline.h gc_mark.h weakpointer.h new_gc_alloc.h gc_allocator.h gc_backptr.h gc_gcj.h leak_detector.h gc_amiga_redirects.h gc_pthread_redirects.h gc_config_macros.h gc_tiny_fl.h gc_ve rsion.h cord.h ) make[1]: Leaving directory `/e/Dev_Tools/gc/gc-7.2'
然后重新去
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
下载gc-7.2d.tar.gz,解压,再去gc-7.2d中执行./configure,再make,再make check,再make install,
注:如果还是不行,打算去
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
中多找几个版本试试。
然后再回到w3m-0.5.3中,先make clean再./configure,再make,结果问题依旧。
8.暂时就折腾到此吧,不想继续弄了。
转载请注明:在路上 » 【未解决】MingW下,make编译w3m出错:main.c:836:23: error: void value not ignored as it ought to be,warning: passing argument 1 of ‘wtf_parse1’ from incompatible pointer type [enabled by default],./libwc/wtf.h:71:19: note: expected ‘wc_uchar **’ but argument is of type ‘char **’