Hi, Thanks, I followed your explanation and tried to build it on windows but I faced these errors :
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(6,1): error C2653: 'PThreadPool': is not a class
or namespace name [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(7,5): error C4430: missing type specifier - int
assumed. Note: C++ does not support default-int [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(7,19): error C3861: 'pthreadpool_create': identi
fier not found [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(7,53): error C2065: 'pthreadpool_destroy': undec
lared identifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(7,74): error C2550: 'caffe2::PThreadPool': const
ructor initializer lists are only allowed on constructor definitions [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.
vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(9,8): error C2653: 'PThreadPool': is not a class
or namespace name [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(9,46): error C2270: 'get_thread_count': modifier
s not allowed on nonmember functions [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(10,8): error C2039: 'lock_guard': is not a membe
r of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(10,18): error C2065: 'lock_guard': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(10,24): error C2039: 'mutex': is not a member of
'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(10,29): error C2065: 'mutex': undeclared identif
ier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(10,31): error C2065: 'lock': undeclared identifi
er [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(10,36): error C2065: 'mutex_': undeclared identi
fier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(12,3): error C2065: 'threadpool_': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(13,40): error C2065: 'threadpool_': undeclared i
dentifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(13,10): error C3861: 'pthreadpool_get_threads_co
unt': identifier not found [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(16,6): error C2653: 'PThreadPool': is not a clas
s or namespace name [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(17,8): error C2039: 'lock_guard': is not a membe
r of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(17,18): error C2065: 'lock_guard': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(17,24): error C2039: 'mutex': is not a member of
'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(17,29): error C2065: 'mutex': undeclared identif
ier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(17,31): error C2065: 'lock': undeclared identifi
er [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(17,36): error C2065: 'mutex_': undeclared identi
fier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(25,3): error C2065: 'threadpool_': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(25,21): error C3861: 'pthreadpool_create': ident
ifier not found [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(28,6): error C2653: 'PThreadPool': is not a clas
s or namespace name [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(29,16): error C2039: 'function': is not a member
of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(29,24): error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(29,24): error C2143: syntax error: missing ',' b
efore '<' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(31,8): error C2039: 'lock_guard': is not a membe
r of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(31,18): error C2065: 'lock_guard': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(31,24): error C2039: 'mutex': is not a member of
'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(31,29): error C2065: 'mutex': undeclared identif
ier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(31,31): error C2065: 'lock': undeclared identifi
er [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(31,36): error C2065: 'mutex_': undeclared identi
fier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(33,3): error C2065: 'threadpool_': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
generated_unboxing_wrappers_2.cpp
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(36,16): error C2039: 'function': is not a member
of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\vector(24): message :
see declaration of 'std' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(36,24): error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(36,24): error C2143: syntax error: missing ';' b
efore '<' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(36,42): error C2238: unexpected token(s) precedi
ng ';' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(38,7): error C2065: 'fn': undeclared identifier
[C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(42,7): error C2065: 'threadpool_': undeclared id
entifier [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(48,46): error C2039: 'fn': is not a member of 'c
affe2::run::Context' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(35): message : see declaration of 'caffe2::run::
Context' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(48,1): error C2039: '__this': is not a member of
'caffe2::run::Context' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(35): message : see declaration of 'caffe2::run::
Context' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(51,7): error C2065: 'range': undeclared identifi
er [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(41,3): error C3861: 'pthreadpool_parallelize_1d'
: identifier not found [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,12): error C2143: syntax error: missing ';' b
efore '*' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,12): error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,1): error C2365: 'caffe2::PThreadPool': redef
inition; previous definition was 'function' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(6): message : see declaration of 'caffe2::PThrea
dPool' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,28): error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,28): error C2059: syntax error: '{' [C:\Users
\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,28): error C2143: syntax error: missing ';' b
efore '{' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(58,28): error C2447: '{': missing function heade
r (old-style formal list?) [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(64,27): error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(64,15): error C2146: syntax error: missing ';' b
efore identifier 'pthreadpool_' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(64,30): error C2143: syntax error: missing ';' b
efore '{' [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
C:\Users\User\pytorch-1.7.0\caffe2\utils\threadpool\pthreadpool-cpp.cc(64,30): error C2447: '{': missing function heade
r (old-style formal list?) [C:\Users\User\pytorch-build-dir\caffe2\torch_cpu.vcxproj]
VariableType_0.cpp
Update1 :
OK I manually excluded the pthreadpool-cpp.cc
from torch_cpu project and everything seemingly build successfully and I have bunch of lib files.
However upon linking I’m getting these errors :
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol sswap_ referenced in function "void __cdecl THFloatBlas_swap(__int64,float *,__int64,float *,__int64)" (?THFloatBlas_swap@@YAX_JPEAM010@Z) Detector_MTCNN_Test D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector_Test\torch_cpu.lib(THBlas.obj) 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl c10::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,struct c10::Half const &)" (__imp_??6c10@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV12@AEBUHalf@0@@Z) referenced in function "public: void __cdecl <lambda_4b127653adfae3530aa9273c394680d7>::operator()(void)const " (??R<lambda_4b127653adfae3530aa9273c394680d7>@@QEBAXXZ) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl c10::Scalar::Scalar(void)" (__imp_??0Scalar@c10@@QEAA@XZ) referenced in function "public: __cdecl torch::detail::TensorDataContainer::TensorDataContainer(class c10::ArrayRef<__int64>)" (??0TensorDataContainer@detail@torch@@QEAA@V?$ArrayRef@_J@c10@@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) protected: __cdecl c10::intrusive_ptr_target::intrusive_ptr_target(class c10::intrusive_ptr_target const &)" (__imp_??0intrusive_ptr_target@c10@@IEAA@AEBV01@@Z) referenced in function "public: __cdecl c10::ivalue::Object::Object(struct c10::ivalue::Object const &)" (??0Object@ivalue@c10@@QEAA@AEBU012@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) protected: class c10::intrusive_ptr_target & __cdecl c10::intrusive_ptr_target::operator=(class c10::intrusive_ptr_target const &)" (__imp_??4intrusive_ptr_target@c10@@IEAAAEAV01@AEBV01@@Z) referenced in function "public: struct c10::ivalue::Object & __cdecl c10::ivalue::Object::operator=(struct c10::ivalue::Object const &)" (??4Object@ivalue@c10@@QEAAAEAU012@AEBU012@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl c10::TensorOptions::TensorOptions(class caffe2::TypeMeta)" (__imp_??0TensorOptions@c10@@QEAA@VTypeMeta@caffe2@@@Z) referenced in function "public: class at::Tensor __cdecl DetectorImpl::GetAffineTransformMatrix(class at::Tensor,class at::Tensor)" (?GetAffineTransformMatrix@DetectorImpl@@QEAA?AVTensor@at@@V23@0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class at::Tensor & __cdecl at::Tensor::operator*=(class c10::Scalar)" (__imp_??XTensor@at@@QEAAAEAV01@VScalar@c10@@@Z) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class at::Tensor __cdecl at::Tensor::operator[](class at::Tensor)const " (__imp_??ATensor@at@@QEBA?AV01@V01@@Z) referenced in function "public: class at::Tensor __cdecl DetectorImpl::NMS(class at::Tensor,float,enum NMSMode)" (?NMS@DetectorImpl@@QEAA?AVTensor@at@@V23@MW4NMSMode@@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class at::Tensor __cdecl at::Tensor::index(class std::initializer_list<struct at::indexing::TensorIndex>)const " (__imp_?index@Tensor@at@@QEBA?AV12@V?$initializer_list@UTensorIndex@indexing@at@@@std@@@Z) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class at::Tensor & __cdecl at::Tensor::index_put_(class std::initializer_list<struct at::indexing::TensorIndex>,class at::Tensor const &)" (__imp_?index_put_@Tensor@at@@QEAAAEAV12@V?$initializer_list@UTensorIndex@indexing@at@@@std@@AEBV12@@Z) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class at::Tensor & __cdecl at::Tensor::index_put_(class std::initializer_list<struct at::indexing::TensorIndex>,class c10::Scalar)" (__imp_?index_put_@Tensor@at@@QEAAAEAV12@V?$initializer_list@UTensorIndex@indexing@at@@@std@@VScalar@c10@@@Z) referenced in function "public: class std::array<class at::Tensor,10> __cdecl DetectorImpl::CorrectBBoxes(class at::Tensor,float,float)" (?CorrectBBoxes@DetectorImpl@@QEAA?AV?$array@VTensor@at@@$09@std@@VTensor@at@@MM@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::Slice::Slice(class c10::optional<__int64>,class c10::optional<__int64>,class c10::optional<__int64>)" (__imp_??0Slice@indexing@at@@QEAA@V?$optional@_J@c10@@00@Z) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(__int64)" (__imp_??0TensorIndex@indexing@at@@QEAA@_J@Z) referenced in function "public: class at::Tensor __cdecl DetectorImpl::NMS(class at::Tensor,float,enum NMSMode)" (?NMS@DetectorImpl@@QEAA?AVTensor@at@@V23@MW4NMSMode@@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(int)" (__imp_??0TensorIndex@indexing@at@@QEAA@H@Z) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(struct at::indexing::Slice)" (__imp_??0TensorIndex@indexing@at@@QEAA@USlice@12@@Z) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::TensorIndex(class at::Tensor)" (__imp_??0TensorIndex@indexing@at@@QEAA@VTensor@2@@Z) referenced in function "public: class std::array<class at::Tensor,10> __cdecl DetectorImpl::CorrectBBoxes(class at::Tensor,float,float)" (?CorrectBBoxes@DetectorImpl@@QEAA?AV?$array@VTensor@at@@$09@std@@VTensor@at@@MM@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl at::indexing::TensorIndex::~TensorIndex(void)" (__imp_??1TensorIndex@indexing@at@@QEAA@XZ) referenced in function "public: __cdecl SimilarityTransform::SimilarityTransform(class at::Tensor,float,float,class at::Tensor)" (??0SimilarityTransform@@QEAA@VTensor@at@@MM0@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: struct c10::StrongTypePtr & __cdecl c10::StrongTypePtr::operator=(struct c10::StrongTypePtr const &)" (__imp_??4StrongTypePtr@c10@@QEAAAEAU01@AEBU01@@Z) referenced in function "public: struct c10::ivalue::Object & __cdecl c10::ivalue::Object::operator=(struct c10::ivalue::Object const &)" (??4Object@ivalue@c10@@QEAAAEAU012@AEBU012@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: struct c10::StrongTypePtr & __cdecl c10::StrongTypePtr::operator=(struct c10::StrongTypePtr &&)" (__imp_??4StrongTypePtr@c10@@QEAAAEAU01@$$QEAU01@@Z) referenced in function "public: struct c10::ivalue::Object & __cdecl c10::ivalue::Object::operator=(struct c10::ivalue::Object &&)" (??4Object@ivalue@c10@@QEAAAEAU012@$$QEAU012@@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: struct c10::IValue __cdecl torch::jit::Module::forward(class std::vector<struct c10::IValue,class std::allocator<struct c10::IValue> >)" (__imp_?forward@Module@jit@torch@@QEAA?AUIValue@c10@@V?$vector@UIValue@c10@@V?$allocator@UIValue@c10@@@std@@@std@@@Z) referenced in function "public: struct std::pair<class at::Tensor,class at::Tensor> __cdecl DetectorImpl::DetectFaces(class cv::Mat &,float,class std::array<float,3>,class std::array<float,3>)" (?DetectFaces@DetectorImpl@@QEAA?AU?$pair@VTensor@at@@V12@@std@@AEAVMat@cv@@MV?$array@M$02@3@1@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: void __cdecl torch::jit::Module::eval(void)" (__imp_?eval@Module@jit@torch@@QEAAXXZ) referenced in function "public: struct std::pair<class at::Tensor,class at::Tensor> __cdecl DetectorImpl::DetectFaces(class cv::Mat &,float,class std::array<float,3>,class std::array<float,3>)" (?DetectFaces@DetectorImpl@@QEAA?AU?$pair@VTensor@at@@V12@@std@@AEAVMat@cv@@MV?$array@M$02@3@1@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\Detector.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) bool __cdecl fbgemm::fbgemmSupportedCPU(void)" (__imp_?fbgemmSupportedCPU@fbgemm@@YA_NXZ) referenced in function "public: class std::vector<enum c10::QEngine,class std::allocator<enum c10::QEngine> > __cdecl <lambda_fcc5437ea6fb470d27a4c81929ec1286>::operator()(void)const " (??R<lambda_fcc5437ea6fb470d27a4c81929ec1286>@@QEBA?AV?$vector@W4QEngine@c10@@V?$allocator@W4QEngine@c10@@@std@@@std@@XZ) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\torch_cpu.lib(Context.cpp.obj) 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl fbgemm::Quantize<signed char,0>(float const *,signed char *,int,struct fbgemm::TensorQuantizationParams const &,int,int)" (__imp_??$Quantize@C$0A@@fbgemm@@YAXPEBMPEACHAEBUTensorQuantizationParams@0@HH@Z) referenced in function "void __cdecl at::native::quantize_vec<struct c10::qint8,8>(double,__int64,float const *,struct c10::qint8 *,unsigned __int64)" (??$quantize_vec@Uqint8@c10@@$07@native@at@@YAXN_JPEBMPEAUqint8@c10@@_K@Z) Detector D:\Codes\fac_ver\cpp\port\LibtorchPort\Detector\torch_cpu.lib(affine_quantizer.obj) 1
Heres the full linker errors : https://paste.ee/p/AFZ1l
and this is the VS output : https://paste.ee/p/uF8Jz
which shows linker warnings such as :
1> Creating library D:\Codes\fac_ver\cpp\port\LibtorchPort\x64\Debug\Test_dummy.lib and object D:\Codes\fac_ver\cpp\port\LibtorchPort\x64\Debug\Test_dummy.exp
1>LINK : warning LNK4217: symbol '??0Error@c10@@QEAA@USourceLocation@1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z (public: __cdecl c10::Error::Error(struct c10::SourceLocation,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >))' defined in 'c10.lib(Logging.obj)' is imported by 'Test_dummy.obj' in function '"public: __cdecl torch::detail::TensorDataContainer::TensorDataContainer(class std::initializer_list<struct torch::detail::TensorDataContainer>)" (??0TensorDataContainer@detail@torch@@QEAA@V?$initializer_list@UTensorDataContainer@detail@torch@@@std@@@Z)'
1>LINK : warning LNK4217: symbol '?msg@Error@c10@@QEBAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ (public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl c10::Error::msg(void)const )' defined in 'c10.lib(Logging.obj)' is imported by 'Test_dummy.obj' in function '__catch$?ToTensor@@YA?AVTensor@at@@AEBVMat@cv@@AEB_N1AEBH@Z$0'
What should I do?
I’m building 1.7.0 as well (cpu only)
I’d greatly appreciate any kind of help in this.