Closed 18930215187 closed 1 year ago
Same here for me libprotobuf-lite is causing lnk2005
@18930215187, Could you try rel-1.16.0? That version shall be good.
@tianleiwu, Doesn't work for me still the same error I tried on 1.15.0
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::internal::LogMessage::LogMessage(enum google::protobuf::LogLevel,char const *,int)" (??0LogMessage@internal@proto
buf@google@@QEAA@W4LogLevel@23@PEBDH@Z) already defined in libprotobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::internal::LogMessage::~LogMessage(void)" (??1LogMessage@internal@protobuf@google@@QEAA@XZ) already defined in lib
protobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: class google::protobuf::internal::LogMessage & __cdecl google::protobuf::internal::LogMessage::operator<<(char const *)" (??6LogMessage@int
ernal@protobuf@google@@QEAAAEAV0123@PEBD@Z) already defined in libprotobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::LogFinisher::operator=(class google::protobuf::internal::LogMessage &)" (??4LogFinisher@internal@p
rotobuf@google@@QEAAXAEAVLogMessage@123@@Z) already defined in libprotobuf-lite.lib(common.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(class std::basic_string<char,struct std::char_traits<char>,class std::allocato
r<char> > const &,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) already defined in lib
protobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(char const *,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@p
rotobuf@google@@QEAAXPEBDPEAVArena@34@@Z) already defined in onnx.lib(defs.cc.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * __cdecl google::protobuf::internal::ArenaStringPt
r::Mutable(class google::protobuf::Arena *)" (?Mutable@ArenaStringPtr@internal@protobuf@google@@QEAAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) already defined in libprot
obuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::ParseFromString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator
<char> > const &)" (?ParseFromString@MessageLite@protobuf@google@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users
\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::SerializeToString(class std::basic_string<char,struct std::char_traits<char>,class std::allocat
or<char> > *)const " (?SerializeToString@MessageLite@protobuf@google@@QEBA_NPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\U
sers\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl google::protobuf::MessageLite::SerializeAsS
tring(void)const " (?SerializeAsString@MessageLite@protobuf@google@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\
GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::DestroyProtos(void)" (?DestroyProtos@RepeatedPtrFieldBase@internal@protob
uf@google@@IEAAXXZ) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: void * __cdecl google::protobuf::internal::RepeatedPtrFieldBase::AddOutOfLineHelper(void *)" (?AddOutOfLineHelper@RepeatedPtrFieldBase@int
ernal@protobuf@google@@AEAAPEAXPEAX@Z) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::ParseFromZeroCopyStream(class google::protobuf::io::ZeroCopyInputStream *)" (?ParseFromZeroCopy
Stream@MessageLite@protobuf@google@@QEAA_NPEAVZeroCopyInputStream@io@23@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_
test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::FileInputStream::FileInputStream(int,int)" (??0FileInputStream@io@protobuf@google@@QEAA@HH@Z) already defined
in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::FileInputStream::~FileInputStream(void)" (??1FileInputStream@io@protobuf@google@@UEAA@XZ) already def
ined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Set(class std::basic_string<char,struct std::char_traits<char>,class std::allocato
r<char> > &&,class google::protobuf::Arena *)" (?Set@ArenaStringPtr@internal@protobuf@google@@QEAAX$$QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z) already defined in libpro
tobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "void __cdecl google::protobuf::ShutdownProtobufLibrary(void)" (?ShutdownProtobufLibrary@protobuf@google@@YAXXZ) already defined in libprotobuf-lite
.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::CodedInputStream::~CodedInputStream(void)" (??1CodedInputStream@io@protobuf@google@@QEAA@XZ) already defined
in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: int __cdecl google::protobuf::io::CodedInputStream::PushLimit(int)" (?PushLimit@CodedInputStream@io@protobuf@google@@QEAAHH@Z) already defi
ned in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::io::CodedInputStream::PopLimit(int)" (?PopLimit@CodedInputStream@io@protobuf@google@@QEAAXH@Z) already defin
ed in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::MergeFromCodedStream(class google::protobuf::io::CodedInputStream *)" (?MergeFromCodedStream@Me
ssageLite@protobuf@google@@QEAA_NPEAVCodedInputStream@io@23@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcx
proj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::ParseFromArray(void const *,int)" (?ParseFromArray@MessageLite@protobuf@google@@QEAA_NPEBXH@Z)
already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::SerializeToOstream(class std::basic_ostream<char,struct std::char_traits<char> > *)const " (?Se
rializeToOstream@MessageLite@protobuf@google@@QEBA_NPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Window
s\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "void __cdecl google::protobuf::internal::GenericSwap(class google::protobuf::MessageLite *,class google::protobuf::MessageLite *)" (?GenericSwap@in
ternal@protobuf@google@@YAXPEAVMessageLite@23@0@Z) already defined in libprotobuf-lite.lib(generated_message_util.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxpro
j]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::Destroy(void)" (?Destroy@ArenaStringPtr@internal@protobuf@google@@QEAAXXZ) already
defined in libprotobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::CloseGap(int,int)" (?CloseGap@RepeatedPtrFieldBase@internal@protobuf@goog
le@@IEAAXHH@Z) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MessageLite::SerializeToZeroCopyStream(class google::protobuf::io::ZeroCopyOutputStream *)const " (?Serializ
eToZeroCopyStream@MessageLite@protobuf@google@@QEBA_NPEAVZeroCopyOutputStream@io@23@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\
onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: bool __cdecl google::protobuf::io::CopyingOutputStreamAdaptor::Flush(void)" (?Flush@CopyingOutputStreamAdaptor@io@protobuf@google@@QEAA_NXZ
) already defined in libprotobuf-lite.lib(zero_copy_stream_impl_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::FileOutputStream::FileOutputStream(int,int)" (??0FileOutputStream@io@protobuf@google@@QEAA@HH@Z) already defi
ned in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::FileOutputStream::~FileOutputStream(void)" (??1FileOutputStream@io@protobuf@google@@UEAA@XZ) already
defined in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: __cdecl google::protobuf::io::IstreamInputStream::IstreamInputStream(class std::basic_istream<char,struct std::char_traits<char> > *,int)"
(??0IstreamInputStream@io@protobuf@google@@QEAA@PEAV?$basic_istream@DU?$char_traits@D@std@@@std@@H@Z) already defined in libprotobuf-lite.lib(zero_copy_stream_impl.obj) [C:\Users\GentBinaku\onnxruntime\build\
Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::IstreamInputStream::~IstreamInputStream(void)" (??1IstreamInputStream@io@protobuf@google@@UEAA@XZ) al
ready defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "protected: void __cdecl google::protobuf::internal::RepeatedPtrFieldBase::Reserve(int)" (?Reserve@RepeatedPtrFieldBase@internal@protobuf@google@@IE
AAXH@Z) already defined in libprotobuf-lite.lib(repeated_ptr_field.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliased(unsigned int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,unsigned char *)" (?WriteStringMaybeAliased@EpsCopyOutputStream@io@protobuf@google@@QEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator
@D@2@@std@@PEAE@Z) already defined in onnx_proto.lib(onnx-ml.pb.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char *)" (?EnsureSpaceFallback@EpsCopyOutp
utStream@io@protobuf@google@@AEAAPEAEPEAE@Z) already defined in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteRawFallback(void const *,int,unsigned char *)" (?WriteRawFallback@
EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEPEBXHPEAE@Z) already defined in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxpro
j]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: unsigned char * __cdecl google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int,class std::basic_string<char,struct std
::char_traits<char>,class std::allocator<char> > const &,unsigned char *)" (?WriteStringOutline@EpsCopyOutputStream@io@protobuf@google@@AEAAPEAEIAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std
@@PEAE@Z) already defined in libprotobuf-lite.lib(coded_stream.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned char * __cdecl google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(unsigned int,unsigned char *)" (?WriteVarint32
ToArray@CodedOutputStream@io@protobuf@google@@SAPEAEIPEAE@Z) already defined in libprotobuf-lite.lib(extension_set.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxpr
oj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned char * __cdecl google::protobuf::io::CodedOutputStream::WriteVarint64ToArray(unsigned __int64,unsigned char *)" (?WriteVari
nt64ToArray@CodedOutputStream@io@protobuf@google@@SAPEAE_KPEAE@Z) already defined in libprotobuf-lite.lib(extension_set.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.
vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ThreadSafeArena::AddCleanup(void *,void (__cdecl*)(void *))" (?AddCleanup@ThreadSafeArena@internal
@protobuf@google@@QEAAXPEAXP6AX0@Z@Z) already defined in libprotobuf-lite.lib(arena.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: struct std::pair<void *,struct google::protobuf::internal::SerialArena::CleanupNode *> __cdecl google::protobuf::Arena::AllocateAlignedWit
hCleanup(unsigned __int64,class type_info const *)" (?AllocateAlignedWithCleanup@Arena@protobuf@google@@AEAA?AU?$pair@PEAXPEAUCleanupNode@SerialArena@internal@protobuf@google@@@std@@_KPEBVtype_info@@@Z) alrea
dy defined in libprotobuf-lite.lib(arena.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: void __cdecl google::protobuf::internal::ArenaStringPtr::ClearToEmpty(void)" (?ClearToEmpty@ArenaStringPtr@internal@protobuf@google@@QEAAXX
Z) already defined in libprotobuf-lite.lib(arenastring.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: void __cdecl google::protobuf::internal::InternalMetadata::DoClear<class std::basic_string<char,struct std::char_traits<char>,class std::a
llocator<char> > >(void)" (??$DoClear@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@InternalMetadata@internal@protobuf@google@@AEAAXXZ) already defined in libprotobuf-lite.lib(message_lite.ob
j) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: void __cdecl google::protobuf::internal::InternalMetadata::DoMergeFrom<class std::basic_string<char,struct std::char_traits<char>,class st
d::allocator<char> > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$DoMergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Internal
Metadata@internal@protobuf@google@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in libprotobuf-lite.lib(message_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Wi
ndows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::MessageLite::~MessageLite(void)" (??1MessageLite@protobuf@google@@UEAA@XZ) already defined in onnx_proto.
lib(onnx-ml.pb.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned char * __cdecl google::protobuf::internal::WireFormatLite::InternalWriteMessage(int,class google::protobuf::MessageLite con
st &,int,unsigned char *,class google::protobuf::io::EpsCopyOutputStream *)" (?InternalWriteMessage@WireFormatLite@internal@protobuf@google@@SAPEAEHAEBVMessageLite@34@HPEAEPEAVEpsCopyOutputStream@io@34@@Z) al
ready defined in libprotobuf-lite.lib(wire_format_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: static unsigned __int64 __cdecl google::protobuf::internal::WireFormatLite::Int64Size(class google::protobuf::RepeatedField<__int64> const
&)" (?Int64Size@WireFormatLite@internal@protobuf@google@@SA_KAEBV?$RepeatedField@_J@34@@Z) already defined in libprotobuf-lite.lib(wire_format_lite.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithD
ebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "class google::protobuf::MessageLite * __cdecl google::protobuf::internal::GetOwnedMessageInternal(class google::protobuf::Arena *,class google::pro
tobuf::MessageLite *,class google::protobuf::Arena *)" (?GetOwnedMessageInternal@internal@protobuf@google@@YAPEAVMessageLite@23@PEAVArena@23@PEAV423@0@Z) already defined in libprotobuf-lite.lib(generated_mess
age_util.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: char const * __cdecl google::protobuf::internal::EpsCopyInputStream::ReadString(char const *,int,class std::basic_string<char,struct std::c
har_traits<char>,class std::allocator<char> > *)" (?ReadString@EpsCopyInputStream@internal@protobuf@google@@QEAAPEBDPEBDHPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in
libprotobuf-lite.lib(extension_set.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: char const * __cdecl google::protobuf::internal::ParseContext::ParseMessage(class google::protobuf::MessageLite *,char const *)" (?ParseMes
sage@ParseContext@internal@protobuf@google@@QEAAPEBDPEAVMessageLite@34@PEBD@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxrunt
ime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "private: char const * __cdecl google::protobuf::internal::ParseContext::ReadSizeAndPushLimitAndDepth(char const *,int *)" (?ReadSizeAndPushLimitAnd
Depth@ParseContext@internal@protobuf@google@@AEAAPEBDPEBDPEAH@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.v
cxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "struct std::pair<char const *,unsigned __int64> __cdecl google::protobuf::internal::VarintParseSlow64(char const *,unsigned int)" (?VarintParseSlow
64@internal@protobuf@google@@YA?AU?$pair@PEBD_K@std@@PEBDI@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxp
roj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "struct std::pair<char const *,unsigned int> __cdecl google::protobuf::internal::ReadTagFallback(char const *,unsigned int)" (?ReadTagFallback@inter
nal@protobuf@google@@YA?AU?$pair@PEBDI@std@@PEBDI@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "struct std::pair<char const *,int> __cdecl google::protobuf::internal::ReadSizeFallback(char const *,unsigned int)" (?ReadSizeFallback@internal@pro
tobuf@google@@YA?AU?$pair@PEBDH@std@@PEBDI@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::InlineGreedyStringParser(class std::basic_string<char,struct std::char_traits<char>,class std::all
ocator<char> > *,char const *,class google::protobuf::internal::ParseContext *)" (?InlineGreedyStringParser@internal@protobuf@google@@YAPEBDPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEB
DPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::PackedInt64Parser(void *,char const *,class google::protobuf::internal::ParseContext *)" (?PackedI
nt64Parser@internal@protobuf@google@@YAPEBDPEAXPEBDPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime
_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::PackedFloatParser(void *,char const *,class google::protobuf::internal::ParseContext *)" (?PackedF
loatParser@internal@protobuf@google@@YAPEBDPEAXPEBDPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime
_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::PackedDoubleParser(void *,char const *,class google::protobuf::internal::ParseContext *)" (?Packed
DoubleParser@internal@protobuf@google@@YAPEBDPEAXPEBDPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxrunti
me_test_all.vcxproj]
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "char const * __cdecl google::protobuf::internal::UnknownFieldParse(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class st
d::allocator<char> > *,char const *,class google::protobuf::internal::ParseContext *)" (?UnknownFieldParse@internal@protobuf@google@@YAPEBDIPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEB
DPEAVParseContext@123@@Z) already defined in libprotobuf-lite.lib(parse_context.obj) [C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
C:\Users\GentBinaku\onnxruntime\build\Windows\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_all.exe : fatal error LNK1169: one or more multiply defined symbols found [C:\Users\GentBinaku\onnxruntime\build\Wi
ndows\RelWithDebInfo\onnxruntime_test_all.vcxproj]
@18930215187, Could you try rel-1.16.0? That version shall be good.
I think I shouldn't try rel-1.16.0, because the rust crate named ort(unofficial) is not support onnxruntime 1.16.0 yet, but I will help you identify the problem by this way
@18930215187, Could you try rel-1.16.0? That version shall be good.
@tianleiwu The same error occured
It looks like libprotobuf-lite.lib (static lib) contains its own DLL. It may cause duplicate symbols.
It looks like libprotobuf-lite.lib (static lib) contains its own DLL. It may cause duplicate symbols.
@kazssym , How can I solve this problem?
Could you try adding -skip_submodule_sync
The same error occured
@mszhanyi The same error occured
It looks like libprotobuf-lite.lib (static lib) contains its own DLL. It may cause duplicate symbols.
@kazssym , How can I solve this problem?
Unfortunately, I don't know much about how the library was built. It probably requires to be rebuilt?
How about adding "--cmake_extra_defines FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER" to your build command? If the problem still exists, please try to do the build in a clean docker container or a clean newly installed Windows machine.
You hit the issue because the protobuf was fetched from vcpkg
G:/Environment/C/vcpkg/installed/x64-windows/bin/libprotobuf.dll
However, its build config it incompatible with the other libs. Please do it without vcpkg.
Describe the issue
Build onnxrunime from source on Windows failed (error LNK2019) CUDA: 11.8.0_522.06 ( 12.2 on my PC too) cuDNN: 8.7.0.84 TensorRT: 8.6.1.6 GPU: nvidia A4000
Urgency
2023/09/27
Target platform
Windows
Build script
git clone -b rel-1.15.1 --recursive https://github.com/Microsoft/onnxruntime cd onnxruntime ./build.bat --build_shared_lib --config "MinSizeRel" --use_dml --use_cuda --use_tensorrt --parallel --skip_tests --compile_no_warning_as_error --cuda_home "G:\Environment\Device\CUDA\11.8" --cudnn_home "G:\Environment\Device\cuDNN" --tensorrt_home "G:\Environment\Device\tensorrt" --cmake_generator "Visual Studio 17 2022"
Error / output
Visual Studio Version
17.7.4
GCC / Compiler Version
No response