我正在尝试在Archlinux中安装vpcs(GNS3需要)但在运行makepkg命令后出现以下错误:
**In file included from hv.c:45:0:
./getopt.h:53:5: error: conflicting types for ‘getopt’
int getopt(int argc, char** argv, char* optstr);
^~~~~~**
In file included from /usr/include/bits/getopt_posix.h:27:0,
from /usr/include/unistd.h:872,
from hv.c:33:
/usr/include/bits/getopt_core.h:91:12: note: previous declaration of ‘getopt’ was here
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
^~~~~~
make: *** [Makefile.linux:38: hv.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...
试图谷歌问题 - 没有运气。有什么帮助吗?
答案 0 :(得分:0)
我遇到了同样的问题,但终于解决了。
$ sudo pacman -S subversion
$ cd /tmp
$ svn checkout svn://svn.code.sf.net/p/vpcs/code/trunk vpcs-code
$ cd vpcs-code/src
$ rgetopt='int getopt(int argc, char *const *argv, const char *optstr);'
$ sed -i "s/^int getopt.*/$rgetopt/" getopt.h
$ unset -v rgetopt
$ sed -i 's/i386/x86_64/' Makefile.linux
$ sed -i 's/-s -static//' Makefile.linux
$ make -f Makefile.linux
$ strip --strip-unneeded vpcs
$ sudo mv vpcs /usr/local/bin
(Source)