More than one instance of overloaded function

匿名 (未验证) 提交于 2019-12-03 01:10:02

问题:

I am trying to compile a library that uses CUDA, on an Ubuntu system using CUDA 8.0 and clang 3.8. The library includes Eigen headers in several *.cu files, which apparently includes the cmath header, causing an ambiguity in the CUDA headers.

/usr/local/cuda-8.0/include/cuda_fp16.h(3068): error: more than one instance of overloaded function "isinf" matches the argument list:             function "std::isinf(float)"             function "isinf(float)"             argument types are: (float) 

CUDA defines its own , and I would expect that std::isinf would have to be called explicitly rather than create a conflict.

Any leads on this would be much appreciated.

回答1:

As I recall, this is actually a Clang problem. Compiling in C++11 mode with Clang 3.8 and gcc 6 standard library headers will trigger the problem. If you switch to a supported gcc 5 version, or don't specify C++11 support, the problem will disappear.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!