Xcode Library not found error

Hello,

I am trying to build a c++ command line application via XCODE and was facing the following error. I am new to development using Xcode and would really appreciate for possible solutions for overcoming the error. I used standard procedures to include opencv frameworks in Xcode applications for example: OpenCV on Xcode | Codementor

dyld[17521]: Library not loaded: /usr/local/opt/opencv/lib/libopencv_gapi.405.dylib

Referenced from: /Users/#####/Library/Developer/Xcode/DerivedData/OPENCV-gzbfcbghvwzksbemedqwzlposgfn/Build/Products/Debug/OPENCV

‘/usr/lib/system/introspection/libopencv_gapi.405.dylib’ (no such file), ‘/usr/local/opt/opencv/lib/libopencv_gapi.405.dylib’ (code signature in ‘/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib’ not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), ‘/usr/local/lib/libopencv_gapi.405.dylib’ (code signature in ‘/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib’ not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), ‘/usr/lib/libopencv_gapi.405.dylib’ (no such file), ‘/Users/######/Library/Developer/Xcode/DerivedData/OPENCV-gzbfcbghvwzksbemedqwzlposgfn/Build/Products/Debug/libopencv_gapi.4.5.5.dylib’ (no such file), ‘/usr/lib/system/introspection/libopencv_gapi.4.5.5.dylib’ (no such file), ‘/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib’ (code signature in ‘/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib’ not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), ‘/usr/local/lib/libopencv_gapi.4.5.5.dylib’ (code signature in ‘/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib’ not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), ‘/usr/lib/libopencv_gapi.4.5.5.dylib’ (no such file)