I was able to fix that error by including my framework directory inside the cinterop
cinterop
iosTarget.compilations["main"].apply { val opencv2 by cinterops.creating{ includeDirs("src/iosMain/opencv2.framework") # This line }