首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Archlinux:无法安装vpcs -错误:‘getopt’的类型冲突

Archlinux:无法安装vpcs -错误:‘getopt’的类型冲突
EN

Stack Overflow用户
提问于 2017-09-27 23:18:33
回答 1查看 738关注 0票数 0

我正在尝试在Archlinux中安装vpcs (GNS3需要),但在运行makepkg命令后出现以下错误:

代码语言:javascript
复制
**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...

我试着在谷歌上搜索这个问题-没找到。有什么帮助吗?

EN

回答 1

Stack Overflow用户

发布于 2018-05-29 08:01:12

我也有同样的问题,但最终还是解决了。

代码语言:javascript
复制
$ 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)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46451587

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档