终端安装程序,make编译时提示错误,怎么解决?
Tofloor
poster avatar
moriwuhen
deepin
2017-08-16 16:59
Author
终端文本如下(或者看图):
$ make
make -C src all
make[1]: Entering directory '/media/zbs/Software/Linux/linux软件/minidwep/aircrack-ng-1.1/src'
make -C osdep
make[2]: Entering directory '/media/zbs/Software/Linux/linux软件/minidwep/aircrack-ng-1.1/src/osdep'
Building for Linux
make[3]: Entering directory '/media/zbs/Software/Linux/linux软件/minidwep/aircrack-ng-1.1/src/osdep'
gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -fPIC -I..    -c -o osdep.o osdep.c
gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -fPIC -I..    -c -o network.o network.c
gcc -g -W -Wall -Werror -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -fPIC -I..    -c -o linux.o linux.c
linux.c: In function ‘is_ndiswrapper’:
linux.c:165:17: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
     int n, pid, unused;
                 ^~~~~~
linux.c: In function ‘linux_set_rate’:
linux.c:334:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
     int pid, status, unused;
                      ^~~~~~
linux.c: In function ‘linux_read’:
linux.c:498:27: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
     memset( buf, 0, sizeof( buf ) );
                           ^
linux.c: In function ‘linux_set_channel’:
linux.c:807:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
     int pid, status, unused;
                      ^~~~~~
linux.c: In function ‘linux_set_freq’:
linux.c:896:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
     int pid, status, unused;
                      ^~~~~~
linux.c: In function ‘set_monitor’:
linux.c:1022:22: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
     int pid, status, unused;
                      ^~~~~~
linux.c: In function ‘openraw’:
linux.c:1259:63: error: comparison of constant ‘6’ with boolean expression is always false [-Werror=bool-compare]
         if (set_monitor( dev, iface, fd ) && !dev->drivertype == DT_ORINOCO )
                                                               ^~
linux.c:1259:63: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
linux.c:1269:67: error: comparison of constant ‘6’ with boolean expression is always false [-Werror=bool-compare]
             if (set_monitor( dev, iface, fd ) && !dev->drivertype == DT_ORINOCO )
                                                                   ^~
linux.c:1269:67: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
linux.c: In function ‘do_linux_open’:
linux.c:1366:12: error: variable ‘unused_str’ set but not used [-Werror=unused-but-set-variable]
     char * unused_str;
            ^~~~~~~~~~
linux.c:1352:15: error: variable ‘unused’ set but not used [-Werror=unused-but-set-variable]
     int kver, unused;
               ^~~~~~
linux.c: In function ‘get_battery_state’:
linux.c:1982:35: error: variable ‘current’ set but not used [-Werror=unused-but-set-variable]
         int rate = 1, remain = 0, current = 0;
                                   ^~~~~~~
cc1: all warnings being treated as errors
: recipe for target 'linux.o' failed
make[3]: *** [linux.o] Error 1
make[3]: Leaving directory '/media/zbs/Software/Linux/linux软件/minidwep/aircrack-ng-1.1/src/osdep'
Makefile:31: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/media/zbs/Software/Linux/linux软件/minidwep/aircrack-ng-1.1/src/osdep'
Makefile:122: recipe for target 'osd' failed
make[1]: *** [osd] Error 2
make[1]: Leaving directory '/media/zbs/Software/Linux/linux软件/minidwep/aircrack-ng-1.1/src'
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 2

安装的程序文件:aircrack-ng-1.1.tar.gz



Reply Favorite View the author
All Replies
avatar
moriwuhen
deepin
2017-08-16 17:09
#1
cd aircrack-ng-1.1
进入目录后,用gedit编辑器打开common.mak
gedit common.mak
修改下面的行:
CFLAGS?= -g -W -Wall -Werror -O3
修改后的结果:
CFLAGS?= -g -W -Wall -O3
执行安装
make
sudo make install
====================
结果又有新的问题。无语了。
Reply View the author
avatar
tmacy
deepin
2017-08-16 18:24
#2
https://bbs.deepin.org/post/144255
cd aircrack-ng-1.1
进入目录后,用gedit编辑器打开common.mak
gedit common.mak

代码有问题,不是编译器改改参数就完事吧
Reply View the author
avatar
moriwuhen
deepin
2017-08-16 18:37
#3
https://bbs.deepin.org/post/144255
代码有问题,不是编译器改改参数就完事吧

都是官方下载的,而且很多人都基于该代码编译过,应该不会有什么大问题。感觉就是系统集成的编译器是不是有什么不对?
Reply View the author
avatar
tmacy
deepin
2017-08-16 19:07
#4
https://bbs.deepin.org/post/144255
都是官方下载的,而且很多人都基于该代码编译过,应该不会有什么大问题。感觉就是系统集成的编译器是不是 ...

1. 试试用clang编译2.换一下gcc版本,目前gcc版本很新,估计旧的代码一些用法被现在的编译器看做是eroor
Reply View the author
avatar
billy123456
deepin
2017-08-16 23:39
#5
https://bbs.deepin.org/post/144255
都是官方下载的,而且很多人都基于该代码编译过,应该不会有什么大问题。感觉就是系统集成的编译器是不是 ...

这个是代码有问题,疑似语法错误
Reply View the author
avatar
SidekickLx
deepin
2017-08-19 05:50
#6
cc1: all warnings being treated as errors 看得到这行么
把-werror去掉就行了
没细看,但是绝大多数都是set but not used
两个是boolean expression is always false 全都是警告
应该没有error
Reply View the author
avatar
moriwuhen
deepin
2017-08-19 06:12
#7
本帖最后由 moriwuhen 于 2017-8-18 22:14 编辑
https://bbs.deepin.org/post/144255
cc1: all warnings being treated as errors 看得到这行么
把-werror去掉就行了
没细看,但是绝大多数都是s ...

有这个可能。
网上也找到这个问题的解决方法,就是修改common.mak文件,将CFLAGS?= -g -W -Wall -Werror -O3
修改为:CFLAGS?= -g -W -Wall -O3。
修改后这个问题解决了,但编译时又出现其他问题。
编译安装reaver-1.4的时候也有类似问题。这几个程序都是5/6年前的了,感觉真可能是上面那位朋友说的,gcc版本太新,导致某些代码不兼容引起的。
Reply View the author
avatar
SidekickLx
deepin
2017-08-19 06:25
#8
http://www.aircrack-ng.org/doku.php?id=install_aircrack#installing_aircrack-ng_from_source
可以参考一下,有一些库的依赖,gcc过新的问题有可能
Reply View the author