NVCC/CUDA 3.1 - ghtr-default.h 泛洪"declared static"但未定义的警告
nvcc/cuda 3.1 - ghtr-default.h flood of "declared static" but not defined warnings
当用nvcc(使用cuda 3.1)编译一个项目时,我从gstr -default.h得到了大量的警告:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:118: warning: ‘int __gthrw_pthread_once(pthread_once_t*, void (*)())’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:119: warning: ‘void* __gthrw_pthread_getspecific(pthread_key_t) throw ()’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:120: warning: ‘int __gthrw_pthread_setspecific(pthread_key_t, const void*) throw ()’ declared ‘static’ but never defined
我到处都挖了,似乎找不到一种方法来抑制这种噪音,除了移除-Wall,我真的不想这么做。有没有人觉得这很眼熟?
我的CXXFLAGS是:
CXXFLAGS=-Isrc -I../cxxtest -I$(CUDA_INCLUDE_DIR) -Xcompiler -O2 -Xcompiler -Wall
我试过将$(CUDA_INCLUDE_DIR)添加到-Xcompiler选项中,但无济于事。我不想把沃尔从设置中移除……还有其他选择吗?
尝试将您的pthreads代码分离到另一个文件中,以便您可以避免# include触发这些警告的文件…
- 为什么即使使用-cudart-static进行编译,库用户仍然需要链接到cuda运行时
- 如何处理 c++ 中类实现中的"invalid use of non-static data member"?
- 如何修复"error: ‘_1’ was not declared in this scope"?
- 收到错误"invalid use of non-static data member 'stu::n' "
- LNK1104:无法打开libpjproject-i386-Win32-vc14-Debug-Static.lib
- 我应该在 C++ 中何时/为什么使用 STATIC?
- 在VS2019项目中集成ImageMagick:x64-windows-static library
- 如何处理Boost Spirit X3导致Visual Studio 2019 "static initialization order fiasco"?
- "static char __ = []() -> char"的含义
- 当初始值设定项是基类名时'initializer does not name a non-static data member or base class'错误
- 无法在 DLL 中链接 SDL2-static.lib
- 如何摆脱C++中未解析的外部符号"private: static char"错误?
- 类中的数组变量C++导致"was not declared in this scope"实现文件的一个函数中错误,但在构造函数中不会导致错误
- C++线程"Call to non-static member function without an object argument"
- 出现这种错误的原因是什么"invalid use of non-static data member "
- static是如何使用ClassA::m_variable处理所有类对象的
- P1008("prohibit aggregates with user-declared constructors")在实践中什么时候有用?
- LNK2001:未解析的外部符号public:static类std::vector
- 使用-static libstdc++时std::线程弱,因此在运行时会导致崩溃
- NVCC/CUDA 3.1 - ghtr-default.h 泛洪"declared static"但未定义的警告