Repository: opencv
Issue: undefined symbol: google::protobuf
Labels: bug,incomplete,category: javascript (js)

### System Information

OpenCV version: 4.8.0
Operating System / Platform: macOS 13.3.1 M1
Compiler & compiler version: GCC 9.3.0

### Detailed description

I'm trying to compile a simple webassembly using yolo and opencv.

The error occurs when I try to run the import of the yolo model like below.

```
Net net = readNet("yolov5s.onnx");
```
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::UnknownFieldSet::MergeFrom(google::protobuf::UnknownFieldSet const&)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::UnknownFieldSet::MergeFrom(google::protobuf::UnknownFieldSet const&)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::RepeatedField<long long>::~RepeatedField()
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: vtable for google::protobuf::MessageLite
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::ThreadSafeArena::~ThreadSafeArena()
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::UnknownFieldSet::ClearFallback()
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::RepeatedField<long long>::~RepeatedField()
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: vtable for google::protobuf::MessageLite
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::ThreadSafeArena::~ThreadSafeArena()
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::UnknownFieldSet::ClearFallback()
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::EpsCopyInputStream::DoneFallback(int, int)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::ReadTagFallback(char const*, unsigned int)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::PackedInt64Parser(void*, char const*, google::protobuf::internal::ParseContext*)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::UnknownFieldParse(unsigned long long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::UnknownFieldParse(unsigned long long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::internal::VarintParseSlow64(char const*, unsigned int)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::RepeatedField<long long>::Reserve(int)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::Arena::AllocateAlignedWithCleanup(unsigned long, std::type_info const*)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char*)
wasm-ld: error: /Volumes/Ficheiros/Dev/opencv/build_wasm/lib/libopencv_dnn.a(opencv-caffe.pb.cc.o): undefined symbol: google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char*)
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)

### Steps to reproduce

```
git clone git@github.com:emirdeliz/yolo-cpp-webassembly-video-object-detector.git
```

Then running:

```
yarn build:webassembly
``` 

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)