查BUG笔记-error:there are no arguments to ‘XXX‘ that depend on a template parameter,so a declaration of

问题

error:there are no arguments to ‘XXX’ that depend on a template parameter,so a declaration of ‘XXX’ must be available[-fpermissive]

原因

linux新版本的gcc 4.3取消了头文件多层关联造成的.
在之前的gcc版本中,只要在当前文件内包含的任何一个头文件里面含有XXX函数的头文件即可,编译器可以从当前文件包含的文件里多层地链接到XXX这个函数。而现在多层链接功能失去了,于是在当前文件里用到的XXX函数就成了来路不明的函数了。解决方法就是在当前文件里面加上#include <XXX.h>这么句话。

参考资料

1.linux编译中error: no arguments depend on a template parameter, declaration of * must 解决

猜你喜欢

转载自blog.csdn.net/liushao1031177/article/details/120139307