我整天都在努力解决这个问题!
最初我遇到了编译器无法找到 corecrt.h 文件的问题。我似乎已经通过将所有包含文件从复制C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
到C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
.
但是现在,我收到了数百个编译错误。我对 C/C++ 不太熟悉,这似乎是一个简单明显的问题吗?
cl : Command line warning D9002 : ignoring unknown option '-m64'
mod.cu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\cuda_runtime.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\cuda_runtime_api.h(1946): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\cuda_runtime_api.h(1946): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(849): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(1787): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(2637): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(3492): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(4431): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(5345): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(6252): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(7142): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\math_functions.h(7956): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\device_functions.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\device_functions.h(774): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\device_functions.h(1618): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\device_double_functions.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\sm_20_intrinsics.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\program files\nvidia gpu computing toolkit\cuda\v8.0\include\sm_20_intrinsics.h(943): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
C:\toolkits\Anaconda3\lib\site-packages\theano-0.8.2-py3.5.egg\theano\sandbox\cuda\cuda_ndarray.cuh(17): warning C4005: 'PyString_Check': macro redefinition
C:\toolkits\Anaconda3\lib\site-packages\numpy\core\include\numpy/npy_3kcompat.h(63): note: see previous definition of 'PyString_Check'
C:\toolkits\Anaconda3\lib\site-packages\theano-0.8.2-py3.5.egg\theano\sandbox\cuda\cuda_ndarray.cuh(18): warning C4005: 'PyString_FromString': macro redefinition
C:\toolkits\Anaconda3\lib\site-packages\numpy\core\include\numpy/npy_3kcompat.h(65): note: see previous definition of 'PyString_FromString'
C:\toolkits\Anaconda3\lib\site-packages\theano-0.8.2-py3.5.egg\theano\sandbox\cuda\cuda_ndarray.cuh(19): warning C4005: 'PyString_AsString': macro redefinition
C:\toolkits\Anaconda3\lib\site-packages\numpy\core\include\numpy/npy_3kcompat.h(72): note: see previous definition of 'PyString_AsString'
C:\toolkits\Anaconda3\lib\site-packages\theano-0.8.2-py3.5.egg\theano\sandbox\cuda\cuda_ndarray.cuh(20): warning C4005: 'PyString_FromStringAndSize': macro redefinition
C:\toolkits\Anaconda3\lib\site-packages\numpy\core\include\numpy/npy_3kcompat.h(66): note: see previous definition of 'PyString_FromStringAndSize'
C:\toolkits\Anaconda3\lib\site-packages\theano-0.8.2-py3.5.egg\theano\sandbox\cuda\cuda_ndarray.cuh(21): warning C4005: 'PyString_Size': macro redefinition
C:\toolkits\Anaconda3\lib\site-packages\numpy\core\include\numpy/npy_3kcompat.h(74): note: see previous definition of 'PyString_Size'
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\cuda_runtime_api.h(1946): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\cuda_runtime_api.h(1946): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vadefs.h(127): error: bool type is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vadefs.h(133): error: bool type is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vadefs.h(139): error: bool type is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\yvals.h(646): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\yvals.h(658): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\yvals.h(659): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\yvals.h(781): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\initializer_list(27): error: identifier "constexpr" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\initializer_list(27): error: member function with the same name as its class must be a constructor
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\initializer_list(27): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\initializer_list(60): error: "constexpr" is not a function or static data member
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\initializer_list(71): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(24): error: identifier "constexpr" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(24): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(26): error: member "std::integral_constant<_Ty, _Val>::_Ty" is not a type name
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(27): error: member "std::integral_constant<_Ty, _Val>::_Ty" is not a type name
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(29): error: identifier "constexpr" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(29): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(45): error: expected a declaration
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(45): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(100): error: "constexpr" is not a function or static data member
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(213): error: identifier "char16_t" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(219): error: identifier "char32_t" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(219): error: class "std::_Is_integral<<error-type>>" has already been defined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(245): error: this declaration has no storage class or type specifier
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(245): error: "constexpr" is not a function or static data member
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(282): error: this declaration has no storage class or type specifier
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(282): error: "constexpr" is not a function or static data member
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(295): error: this declaration has no storage class or type specifier
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtr1common(295): error: "constexpr" is not a function or static data member
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(146): error: explicit type is missing ("int" assumed)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(146): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(181): error: identifier "constexpr" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(181): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(195): error: identifier "constexpr" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(195): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(209): error: identifier "constexpr" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(209): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(223): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(237): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(251): error: member "std::plus<void>::constexpr" is not a valid class member template
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(251): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(268): error: member "std::minus<void>::constexpr" is not a valid class member template
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(268): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(285): error: member "std::multiplies<void>::constexpr" is not a valid class member template
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(285): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(302): error: member "std::equal_to<void>::constexpr" is not a valid class member template
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(302): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(319): error: member "std::less<void>::constexpr" is not a valid class member template
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(319): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(375): error: invalid combination of type specifiers
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(404): error: identifier "char16_t" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(405): error: identifier "char16_t" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(410): error: identifier "char32_t" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(410): error: class "std::hash<<error-type>>" has already been defined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(411): error: identifier "char32_t" is undefined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(635): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(635): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(641): error: type name is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(640): error: template parameter "_Ty1" is not used in or cannot be deduced from the template argument list of class template "std::_Arg_types<<error-constant>>"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(648): error: type name is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(648): error: too many arguments for class template "std::_Arg_types"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(659): error: explicit type is missing ("int" assumed)
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(659): error: expected a ";"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: constant "<unnamed>" is not used in or cannot be deduced from the template argument list of class template "std::_Is_function<_Ret (std::_Types, ...)>"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: class template "std::_Is_function" has already been defined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: constant "<unnamed>" is not used in or cannot be deduced from the template argument list of class template "std::_Is_function<_Ret (std::_Types, ...)>"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: class template "std::_Is_function" has already been defined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: constant "<unnamed>" is not used in or cannot be deduced from the template argument list of class template "std::_Is_function<_Ret (std::_Types, ...)>"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: class template "std::_Is_function" has already been defined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: constant "<unnamed>" is not used in or cannot be deduced from the template argument list of class template "std::_Is_function<_Ret (std::_Types, ...)>"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: class template "std::_Is_function" has already been defined
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: expected a ">"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: expected a ">"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: expected a ">"
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: "..." is not allowed
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: a nontype template parameter may not have class type
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstddef(673): error: expected a ">"
Error limit reached.
100 errors detected in the compilation of "C:/Users/Takkeezi/AppData/Local/Temp/tmpxft_0000c094_00000000-10_mod.cpp1.ii".