我正在構建包含cuda代碼的cmake項目。我無法編譯包含幾個h文件的cuda文件之一。這是編譯器錯誤我收到isspace宏與locale_facets.h中的isspace函數衝突
In file included from /usr/include/c++/4.4/bits/basic_ios.h:39,
from /usr/include/c++/4.4/ios:45,
from /usr/include/c++/4.4/ostream:40,
from /usr/include/c++/4.4/iostream:40,
from /home/pfeifs/Developement/Deform/LinuxDeform/LibDeform/Deform/cutil_comfunc.h:20,
from /home/pfeifs/Developement/Deform/LinuxDeform/LibDeform/Deform/VectorMathDef.h:22,
from /home/pfeifs/Developement/Deform/LinuxDeform/LibDeform/src/Deform/VectorMath.cu:15:
/usr/include/c++/4.4/bits/locale_facets.h:2521:44: error: macro "isspace" passed 2 arguments, but takes just 1
isspace()
被定義爲需要在<ctype.h>
一個參數的宏和聲明爲locale_facets.h
一個模板函數。 (這些都是標準文件。)但是,在locale_facets.h
開頭,包含<cctype>
,並且未聲明宏。
任何幫助或深入瞭解這個問題,非常感謝。
嘗試對'cutil_comfunc.h'文件中的#include文件順序進行重新排序,以使C++包含在C includes之前。如果沒有別的話, – jxh