Unable to compile C++ when building Python module in VisualStudio Code.

Asked 2 years ago, Updated 2 years ago, 34 views

When I ran python setup.py build develop on linko14/AlphaPose-1, I got the following error. VisualStuido is 2017. The original MV of has not changed.I don't know if I should change the settings. If anyone knows, please let me know.
Run Environment
Windows 10
python 3.7
cuda-toolkit 10.0

C:\Users\rinko14\Anaconda3\envs\venv04_tracker\lib\site-packages\torch\utils\cpp_extension.py:184: UserWarning: Error checking compiler version for cl: [WinError 2] 指定されたファイルが見つかりません。
  warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'detector.nms.soft_nms_cpu' extension
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\rinko14\Anaconda3\envs\venv04_tracker\lib\site-packages\numpy\core\include -IC:\Users\rinko14\Anaconda3\envs\venv04_tracker\include -IC:\Users\rinko14\Anaconda3\envs\venv04_tracker\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /Tpdetector\nms\src/soft_nms_cpu.cpp /Fobuild\temp.win-amd64-3.7\Release\detector\nms\src/soft_nms_cpu.obj -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=soft_nms_cpu -D_GLIBCXX_USE_CXX11_ABI=0 /MD
soft_nms_cpu.cpp
c:\users\rinko14\anaconda3\envs\venv04_tracker\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
Scott Thiel - s / opt/jffnms / hh src / Microsoft - s / opt/jffnms / _ pump. cpp (1466 ) : moments when     C4 on November 27 :   the current code page file is     (1932 )   to include characters that can not be displayed in.data loss prevention 
Uni The Unicode     the file format for just like awabi, please.
Scott Thiel - s / opt/jffnms / hh src / Microsoft - s / opt/jffnms / _ pump. cpp (1765 ) :     C 44 30 : type designator  n't have -       and assumptions.Notes :   C ++       to a fixed value and a support by the five hundred disciples 
Logs
Scott Thiel - s / opt/jffnms / hh src / Microsoft - s / opt/jffnms / _ pump. cpp (1765 ) :     C 214 6 : syntax error :     ' ; '   is an identifier   ' Airtight Games, TIFF2, these days). '   required to be taken prior.
Scott Thiel - s / opt/jffnms / hh src / Microsoft - s / opt/jffnms / _ pump. cpp (1765 ) :     C 201 : too many number of characters of the constant  .
Scott Thiel - s / opt/jffnms / hh src / Microsoft - s / opt/jffnms / _ pump. cpp (due to 3,125 ) :     C 4 2 4 4 :   ' = ' :   ' do double '   to   ' float '   the conversion of : Usage : variable ...There is a possibility of losing data.
Yes.
detector\nms\src/soft_nms_cpu.cpp(3134)—Warning C4244: '=': Conversion from 'double' to 'float'.Data can be lost.
Yes.
detector\nms\src/soft_nms_cpu.cpp(3153)—Warning C4244: '=': Conversion from 'double' to 'float'.Data can be lost.
US>Yes, 4\\cl.exe'fail
detector\nms\src/soft_nms_cpu.cpp(3172)—Warning C4244: '=': Conversion from 'double' to 'float'.Data can be lost
Yes.
detector\nms\src/soft_nms_cpu.cpp(3215):warning C4244:'=':'double' to 'float' conversion.Data can be lost
Yes.
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\\\\\MSVC\\14.16.27023\bin\\HostX86\\x6\\\cl.exe' failed with exit status 2

python c++

2022-09-29 22:18

1 Answers

 detector\nms\src/soft_nms_cpu.cpp(1466): The warning C4819: file contains characters that cannot be displayed on the current code page (932).Save the file in Unicode format to avoid data loss.

The warning appears.However, the line or this file did not contain non-ASCII characters in the first place.
Are you editing something?

In any case, the source code could not be interpreted correctly because of this.

detector\nms\src/soft_nms_cpu.cpp(1765): error C4430: type specifier missing -int assumed.NOTE: C++ does not support int as the default value.
Scott Thiel - s / opt/jffnms / hh src / Microsoft - s / opt/jffnms / _ pump. cpp (1765 ) :     C 214 6 : syntax error :     ' ; '   is an identifier   ' Airtight Games, TIFF2, these days). '   required to be taken prior.

Based on the error message, the line pointed out here is

/*Module declarations from 'detector.nms.soft_nms_cpu'*/

However, the comment start /* was not recognized correctly, and the compiler did not recognize it

Module declarations...

has suddenly appeared and is unable to determine what the Module is.Old C languages have the ability to omit typing, so apply it

int Module decarations...

Interpreting and continues.However, if the Module is used as a variable, the subsequent declarations cannot be interpreted further and ; is required.

That's what I'm doing, but the code you're referring to doesn't match the code in GitHub, so I don't know what's going on with a third party.


2022-09-29 22:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.