# Can't open ONNX file on Mac OS X using OpenCV 4.9.0 from brew

**URL:** <https://forum.opencv.org/t/cant-open-onnx-file-on-mac-os-x-using-opencv-4-9-0-from-brew/16484>\
**Category:** Uncategorized\
**Tags:** apple\
**Created:** [February 16, 2024, 8:03pm UTC](https://forum.opencv.org/t/cant-open-onnx-file-on-mac-os-x-using-opencv-4-9-0-from-brew/16484 "2024-02-16T20:03:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lau](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/daniel_lau/32/8567_2.png) [@Daniel\_Lau](https://forum.opencv.org/u/Daniel_Lau)\
**Post date:** [February 16, 2024, 8:03pm UTC](https://forum.opencv.org/t/cant-open-onnx-file-on-mac-os-x-using-opencv-4-9-0-from-brew/16484/1 "2024-02-16T20:03:05Z")

</div>

So I’m compiling a Qt C++ application on both Windows and Mac, linking to local copies of OpenCV. In the case of Windows, I built the library from scratch. On the Mac, I used brew. When I try to load an ONNX file on my Windows application, it works fine. When I try to load on Mac, I get the message, ““OpenCV(4.9.0) /tmp/opencv-20240120-57354-wt6ray/opencv-4.9.0/modules/dnn/src/onnx/onnx\_importer.cpp:4097: error: (-2:Unspecified error) DNN/ONNX: Build OpenCV with Protobuf to import ONNX models in function ‘readNetFromONNX’\n”  
QWidget(0x0) LAUListWidget(0x600003b45680)” This is a brand new error. A month ago or perhaps two, I didn’t have a problem.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 16, 2024, 8:37pm UTC](https://forum.opencv.org/t/cant-open-onnx-file-on-mac-os-x-using-opencv-4-9-0-from-brew/16484/2 "2024-02-16T20:37:28Z")

</div>

talk to whoever maintains the brew thingy. they forgot something.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [February 17, 2024, 5:47am UTC](https://forum.opencv.org/t/cant-open-onnx-file-on-mac-os-x-using-opencv-4-9-0-from-brew/16484/3 "2024-02-17T05:47:36Z")

</div>

idk, if you can set **cmake** options from brew, but try to set:

```
-DWITH_PROTOBUF=ON
-DBUILD_PROTOBUF=ON

```

in order to build/use the [presupplied 3rdparty src](https://github.com/opencv/opencv/tree/4.x/3rdparty/protobuf)
