Visual Studio 中的 Libtorch operator/syntax 个错误
Libtorch operator/syntax errors in Visual Studio
您好,我最近安装了 Libtorch,并且能够在我的新 Visual Studio 项目中毫无问题地使用它。目前我正在尝试在现有的 CUDA 项目中使用 Libtorch。但是当我包含 torch header 时,我遇到了这些奇怪的错误,而且我在互联网上找不到任何关于我的问题的解决方案。有谁知道这些错误的原因是什么?
Severity Code Description Project File Line Suppression State
Error C2833 'operator {' is not a recognized operator or type DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2059 syntax error: 'newline' DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2238 unexpected token(s) preceding ';' DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2143 syntax error: missing ';' before 'const' DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2833 'operator {' is not a recognized operator or type DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
Error C2059 syntax error: 'newline' DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
Error C2238 unexpected token(s) preceding ';' DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
Error C2143 syntax error: missing ';' before 'const' DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
环境
- Windows 10
- CUDA 10.1
- Visual Studio 2017
- C++14
感谢@john,我意识到另一个库中有一个宏,它与 Libtorch 库中的类型名同名(在我的库中是一个名为 V 的宏case),这就是为什么它在编译中被混淆的原因。我现在坚持使用这个解决方案。
warning C4003: not enough actual parameters for macro 'max' - Visual Studio 2010 C++
您好,我最近安装了 Libtorch,并且能够在我的新 Visual Studio 项目中毫无问题地使用它。目前我正在尝试在现有的 CUDA 项目中使用 Libtorch。但是当我包含 torch header 时,我遇到了这些奇怪的错误,而且我在互联网上找不到任何关于我的问题的解决方案。有谁知道这些错误的原因是什么?
Severity Code Description Project File Line Suppression State
Error C2833 'operator {' is not a recognized operator or type DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2059 syntax error: 'newline' DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2238 unexpected token(s) preceding ';' DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2143 syntax error: missing ';' before 'const' DepthSensing e:\research\libtorch\include\c10\util\flat_hash_map.h 1433
Error C2833 'operator {' is not a recognized operator or type DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
Error C2059 syntax error: 'newline' DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
Error C2238 unexpected token(s) preceding ';' DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
Error C2143 syntax error: missing ';' before 'const' DepthSensing e:\research\libtorch\include\c10\util\order_preserving_flat_hash_map.h 1552
环境
- Windows 10
- CUDA 10.1
- Visual Studio 2017
- C++14
感谢@john,我意识到另一个库中有一个宏,它与 Libtorch 库中的类型名同名(在我的库中是一个名为 V 的宏case),这就是为什么它在编译中被混淆的原因。我现在坚持使用这个解决方案。
warning C4003: not enough actual parameters for macro 'max' - Visual Studio 2010 C++