onnx-tensorrt
onnx-tensorrt copied to clipboard
how about compile it with VS2019 in windows?
I compile it wiht VS2019 in windows: TensorRT-8.2.3.0 protobuf-3.16.0
but so many link errors:
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl google::protobuf::io::CodedInputStream::CodedInputStream(class google::protobuf::io::ZeroCopyInputStream *)" (_imp??0CodedInputStream@io@protobuf@google@@QEAA@PEAVZeroCopyInputStream@123@@Z),函数 main 中引用了该符号
2>nvonnxparser_static.lib(ModelImporter.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl google::protobuf::io::CodedInputStream::CodedInputStream(class google::protobuf::io::ZeroCopyInputStream *)" (_imp??0CodedInputStream@io@protobuf@google@@QEAA@PEAVZeroCopyInputStream@123@@Z)
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int,int)" (_imp?SetTotalBytesLimit@CodedInputStream@io@protobuf@google@@QEAAXHH@Z),函数 main 中引用了该符号
2> 已定义且可能匹配的符号上的提示:
2> "__declspec(dllimport) public: void __cdecl google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)" (_imp?SetTotalBytesLimit@CodedInputStream@io@protobuf@google@@QEAAXH@Z)
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: unsigned char * __cdecl google::protobuf::io::CodedOutputStream::GetDirectBufferForNBytesAndAdvance(int)" (_imp?GetDirectBufferForNBytesAndAdvance@CodedOutputStream@io@protobuf@google@@QEAAPEAEH@Z),函数 main 中引用了该符号
2> 已定义且可能匹配的符号上的提示:
2> "__declspec(dllimport) private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::GetDirectBufferForNBytesAndAdvance(int,unsigned char * *)" (_imp?GetDirectBufferForNBytesAndAdvance@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEHPEAPEAE@Z)
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::io::FileInputStream::SetCloseOnDelete(bool)" (_imp?SetCloseOnDelete@FileInputStream@io@protobuf@google@@QEAAX_N@Z),函数 main 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::io::FileOutputStream::SetCloseOnDelete(bool)" (_imp?SetCloseOnDelete@FileOutputStream@io@protobuf@google@@QEAAX_N@Z),函数 main 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __cdecl google::protobuf::MessageLite::ByteSize(void)const " (_imp?ByteSize@MessageLite@protobuf@google@@QEBAHXZ),函数 main 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::MessageLite::SerializeWithCachedSizes(class google::protobuf::io::CodedOutputStream *)const " (_imp?SerializeWithCachedSizes@MessageLite@protobuf@google@@QEBAXPEAVCodedOutputStream@io@23@@Z),函数 main 中引用了该符号
2>nvonnxparser_static.lib(ModelImporter.obj) : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traitsscalar deleting destructor'(unsigned int)" (??_GStringStringEntryProto@onnx2trt_onnx@@UEAAPEAXI@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) protected: __cdecl google::protobuf::internal::RepeatedPtrFieldBase::~RepeatedPtrFieldBase(void)" (__imp_??1RepeatedPtrFieldBase@internal@protobuf@google@@IEAA@XZ),函数 "int public: __cdecl onnx2trt_onnx::AttributeProto::AttributeProto(class AttributeProto::dtor$10 const &)'::1'::dtor$10" (?dtor$10@?0???0AttributeProto@onnx2trt_onnx@@QEAA@AEBV01@@Z@4HA) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::InternalSwap(class google::protobuf::internal::RepeatedPtrFieldBase *)" (__imp_?InternalSwap@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXPEAV1234@@Z),函数 "private: void __cdecl onnx2trt_onnx::AttributeProto::InternalSwap(class onnx2trt_onnx::AttributeProto *)" (?InternalSwap@AttributeProto@onnx2trt_onnx@@AEAAXPEAV12@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) private: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::MergeFromInternal(class google::protobuf::internal::RepeatedPtrFieldBase const &,void (__cdecl google::protobuf::internal::RepeatedPtrFieldBase::*)(void * *,void * *,int,int))" (__imp_?MergeFromInternal@RepeatedPtrFieldBase@internal@protobuf@google@@AEAAXAEBV1234@P81234@EAAXPEAPEAX1HH@Z@Z),函数 "public: virtual void __cdecl onnx2trt_onnx::TensorShapeProto::CopyFrom(class google::protobuf::Message const &)" (?CopyFrom@TensorShapeProto@onnx2trt_onnx@@UEAAXAEBVMessage@protobuf@google@@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::Int32Size(int)" (__imp_?Int32Size@WireFormatLite@internal@protobuf@google@@SA_KH@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::TensorProto::ByteSizeLong(void)const " (?ByteSizeLong@TensorProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2> 已定义且可能匹配的符号上的提示: 2> "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::Int32Size(class google::protobuf::RepeatedField<int> const &)" (__imp_?Int32Size@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$RepeatedField@H@34@@Z) 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::Int64Size(__int64)" (__imp_?Int64Size@WireFormatLite@internal@protobuf@google@@SA_K_J@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::ModelProto::ByteSizeLong(void)const " (?ByteSizeLong@ModelProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2> 已定义且可能匹配的符号上的提示: 2> "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::Int64Size(class google::protobuf::RepeatedField<__int64> const &)" (__imp_?Int64Size@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$RepeatedField@_J@34@@Z) 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::EnumSize(int)" (__imp_?EnumSize@WireFormatLite@internal@protobuf@google@@SA_KH@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::TensorProto::ByteSizeLong(void)const " (?ByteSizeLong@TensorProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::StringSize(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?StringSize@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::ModelProto::ByteSizeLong(void)const " (?ByteSizeLong@ModelProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::BytesSize(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?BytesSize@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::TensorProto::ByteSizeLong(void)const " (?ByteSizeLong@TensorProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::LengthDelimitedSize(unsigned __int64)" (__imp_?LengthDelimitedSize@WireFormatLite@internal@protobuf@google@@SA_K_K@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::ModelProto::ByteSizeLong(void)const " (?ByteSizeLong@ModelProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __cdecl google::protobuf::internal::EpsCopyInputStream::PopLimit(int)" (__imp_?PopLimit@EpsCopyInputStream@internal@protobuf@google@@QEAA_NH@Z),函数 "public: virtual char const * __cdecl onnx2trt_onnx::ModelProto::_InternalParse(char const *,class google::protobuf::internal::ParseContext *)" (?_InternalParse@ModelProto@onnx2trt_onnx@@UEAAPEBDPEBDPEAVParseContext@internal@protobuf@google@@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __cdecl google::protobuf::internal::ParseContext::Done(char const * *)" (__imp_?Done@ParseContext@internal@protobuf@google@@QEAA_NPEAPEBD@Z),函数 "public: virtual char const * __cdecl onnx2trt_onnx::ModelProto::_InternalParse(char const *,class google::protobuf::internal::ParseContext *)" (?_InternalParse@ModelProto@onnx2trt_onnx@@UEAAPEBDPEBDPEAVParseContext@internal@protobuf@google@@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __cdecl google::protobuf::internal::CachedSize::Get(void)const " (__imp_?Get@CachedSize@internal@protobuf@google@@QEBAHXZ),函数 "public: virtual unsigned char * __cdecl onnx2trt_onnx::ModelProto::_InternalSerialize(unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)const " (?_InternalSerialize@ModelProto@onnx2trt_onnx@@UEBAPEAEPEAEPEAVEpsCopyOutputStream@io@protobuf@google@@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::internal::CachedSize::Set(int)" (__imp_?Set@CachedSize@internal@protobuf@google@@QEAAXH@Z),函数 "public: virtual unsigned __int64 __cdecl onnx2trt_onnx::ModelProto::ByteSizeLong(void)const " (?ByteSizeLong@ModelProto@onnx2trt_onnx@@UEBA_KXZ) 中引用了该符号 2> 已定义且可能匹配的符号上的提示: 2> "__declspec(dllimport) public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(struct google::protobuf::internal::ArenaStringPtr::EmptyDefault,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &&,class google::protobuf::Arena *)" (__imp_?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXUEmptyDefault@1234@$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) 2> "__declspec(dllimport) public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(struct google::protobuf::internal::ArenaStringPtr::EmptyDefault,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class google::protobuf::Arena *)" (__imp_?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXUEmptyDefault@1234@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl google::protobuf::internal::CachedSize::CachedSize(void)" (__imp_??0CachedSize@internal@protobuf@google@@QEAA@XZ),函数 "private: static class onnx2trt_onnx::OperatorSetIdProto * __cdecl google::protobuf::Arena::CreateMaybeMessage<class onnx2trt_onnx::OperatorSetIdProto>(class google::protobuf::Arena *)" (??$CreateMaybeMessage@VOperatorSetIdProto@onnx2trt_onnx@@$$V@Arena@protobuf@google@@CAPEAVOperatorSetIdProto@onnx2trt_onnx@@PEAV012@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl google::protobuf::UnknownFieldSet::UnknownFieldSet(void)" (__imp_??0UnknownFieldSet@protobuf@google@@QEAA@XZ),函数 "private: class google::protobuf::UnknownFieldSet * __cdecl google::protobuf::internal::InternalMetadata::mutable_unknown_fields_slow<class google::protobuf::UnknownFieldSet>(void)" (??$mutable_unknown_fields_slow@VUnknownFieldSet@protobuf@google@@@InternalMetadata@internal@protobuf@google@@AEAAPEAVUnknownFieldSet@23@XZ) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl google::protobuf::UnknownFieldSet::Swap(class google::protobuf::UnknownFieldSet *)" (__imp_?Swap@UnknownFieldSet@protobuf@google@@QEAAXPEAV123@@Z),函数 "private: void __cdecl google::protobuf::internal::InternalMetadata::DoSwap<class google::protobuf::UnknownFieldSet>(class google::protobuf::UnknownFieldSet *)" (??$DoSwap@VUnknownFieldSet@protobuf@google@@@InternalMetadata@internal@protobuf@google@@AEAAXPEAVUnknownFieldSet@23@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl google::protobuf::Message::Message(void)" (__imp_??0Message@protobuf@google@@QEAA@XZ),函数 "public: __cdecl onnx2trt_onnx::AttributeProto::AttributeProto(class onnx2trt_onnx::AttributeProto const &)" (??0AttributeProto@onnx2trt_onnx@@QEAA@AEBV01@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) protected: __cdecl google::protobuf::Message::Message(class google::protobuf::Arena *)" (__imp_??0Message@protobuf@google@@IEAA@PEAVArena@12@@Z),函数 "private: static class onnx2trt_onnx::OperatorSetIdProto * __cdecl google::protobuf::Arena::CreateMaybeMessage<class onnx2trt_onnx::OperatorSetIdProto>(class google::protobuf::Arena *)" (??$CreateMaybeMessage@VOperatorSetIdProto@onnx2trt_onnx@@$$V@Arena@protobuf@google@@CAPEAVOperatorSetIdProto@onnx2trt_onnx@@PEAV012@@Z) 中引用了该符号 2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual __cdecl google::protobuf::Message::~Message(void)" (__imp_??1Message@protobuf@google@@UEAA@XZ),函数 "public: virtual void * __cdecl onnx2trt_onnx::StringStringEntryProto::scalar deleting destructor'(unsigned int)" (??_GStringStringEntryProto@onnx2trt_onnx@@UEAAPEAXI@Z) 中引用了该符号
2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2001: 无法解析的外部符号 "public: virtual __cdecl google::protobuf::Message::~Message(void)" (??1Message@protobuf@google@@UEAA@XZ)
2>onnx_proto.lib(onnx_onnx2trt_onnx-ml.pb.obj) : error LNK2001: 无法解析的外部符号 "protected: __cdecl google::protobuf::internal::RepeatedPtrFieldBase::~RepeatedPtrFieldBase(void)" (??1RepeatedPtrFieldBase@internal@protobuf@google@@IEAA@XZ)
2>E:\Item\Item_doing\onnx-tensorrt\onnx-tensorrt\build\Release\onnx2trt.exe : fatal error LNK1120: 39 个无法解析的外部命令
2>已完成生成项目“onnx2trt.vcxproj”的操作 - 失败。
We don't officially support the Windows build of this repository, error seems to becoming from Protobuf. What version do you have installed?
I have test the Protobuf:
but they seem same errors
i complie the probuf as the onnx guide:
https://github.com/onnx/onnx/tree/994c6181247d7b419b28889fc57d5817e2089419

Could help solved the windows compile. I want convert the onnx to tensorrt in windows。Because the tensorrt model must reconvert it in different gpu card compute, it is a big problem to deployment.