opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.45k stars 5.76k forks source link

Linking dnn with dll version of protobuf failed #1242

Open seanlis opened 7 years ago

seanlis commented 7 years ago
System information (version)
Detailed description

While trying to link dnn with a protobuf import library, got about 19 LNK2001 errors:

attr_value.pb.obj : error LNK2001: unresolved external symbol "private: static __int64 google::protobuf::io::CodedOutputStream::default_serialization_deterministic_" (?default_serialization_deterministic_@CodedOutputStream@io@protobuf@google@@0_JA) 
function.pb.obj : error LNK2001: unresolved external symbol "private: static __int64 google::protobuf::io::CodedOutputStream::default_serialization_deterministic_" (?default_serialization_deterministic_@CodedOutputStream@io@protobuf@google@@0_JA) 
......

I have to add PROTOBUF_USE_DLLS definition to the compiler to successfully build.

Steps to reproduce
dkurt commented 7 years ago

@seanlis, we have some experimental usage with own protocol buffers parser. It may help you because dependency on external protobuf will not require. Would you try to checkeout this branches and give feedback for us? Thanks! OpenCV: https://github.com/opencv/opencv/pull/9106 contrib: https://github.com/opencv/opencv_contrib/pull/1291