Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error #8

Closed
muyangquan opened this issue Mar 28, 2016 · 5 comments
Closed

compile error #8

muyangquan opened this issue Mar 28, 2016 · 5 comments

Comments

@muyangquan
Copy link

/usr/local/hiredis-vip/include/adlist.h:73: 错误:对‘list’的引用有歧义
/usr/local/hiredis-vip/include/adlist.h:54: 错误:candidates are: typedef struct list list
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_list.h:417: 错误: template<class _Tp, class _Alloc> class std::list
/usr/local/hiredis-vip/include/adlist.h:73: 错误:expected constructor, destructor, or type conversion before ‘*’ token
/usr/local/hiredis-vip/include/adlist.h:74: 错误:对‘list’的引用有歧义
/usr/local/hiredis-vip/include/adlist.h:54: 错误:candidates are: typedef struct list list
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_list.h:417: 错误: template<class _Tp, class _Alloc> class std::list
/usr/local/hiredis-vip/include/adlist.h:74: 错误:变量或字段‘listRelease’声明为 void
/usr/local/hiredis-vip/include/adlist.h:74: 错误:对‘list’的引用有歧义
/usr/local/hiredis-vip/include/adlist.h:54: 错误:candidates are: typedef struct list list
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_list.h:417: 错误: template<class _Tp, class _Alloc> class std::list

看下吧,兄弟!

@muyangquan
Copy link
Author

跟STL中的list有重复了吧?

@muyangquan
Copy link
Author

为啥用hiredis不会出现这个问题呢?

@deep011
Copy link
Contributor

deep011 commented Apr 5, 2016

你好,@muyangquan
不好意思,这一段在休假,手边没有电脑。你说的这个问题,我刚刚修复了一下,你再试试。谢谢!

@deep011 deep011 closed this as completed Apr 5, 2016
@muyangquan
Copy link
Author

错误少了很多,但还是有。

/usr/local/hiredis-vip/include/hircluster.h:45: 错误:对‘list’的引用有歧义
/usr/local/hiredis-vip/include/hircluster.h:33: 错误:candidates are: struct list
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_list.h:417: 错误: template<class _Tp, class _Alloc> class std::list
/usr/local/hiredis-vip/include/hircluster.h:46: 错误:对‘list’的引用有歧义
/usr/local/hiredis-vip/include/hircluster.h:33: 错误:candidates are: struct list
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_list.h:417: 错误: template<class _Tp, class _Alloc> class std::list
/usr/local/hiredis-vip/include/hircluster.h:94: 错误:对‘list’的引用有歧义
/usr/local/hiredis-vip/include/hircluster.h:33: 错误:candidates are: struct list
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_list.h:417: 错误: template<class _Tp, class _Alloc> class std::list
make: *** [main.o] 错误 1

原因就在于,hircluster.h中引用了list这个结构体,而这个结构体与STL中的list同名。

@deep011
Copy link
Contributor

deep011 commented Apr 19, 2016

不好意思,这个一开始考虑到,我已经把list改名成hilist了,你再试试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants