0

I recently upgraded from Xcode 12.1 to 12.2, on macOS Catalina 10.15.7. My C++ project (which uses OpenCV) compiled without problem with Xcode 12.1. After the upgrade I get a lot of these:

ld: warning: ignoring file /usr/local/Cellar/opencv/4.5.0_5/lib/libopencv_gapi.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

(I would have been unable to work but luckily I noticed that changing the “My Mac” Scheme to use Debug instead of Release for Build Configuration allows it to build without issue. Just runs much slower.)

My web searching suggests this might be related to “universal binary” compilation? Apparently the Apple approved solution is to wait for OpenCV to release a “universal binary” version of the .dylib? Until then:

  • is there a way to say that, for now, I only care about the x86_64 machine I am developing on?
  • is it possible to roll back to Xcode 12.1?
1
  • 1
    It is a setting for architecture you make in your Xcode project - e.g. Build Active Architecture only – mmmmmm Dec 6 '20 at 19:58
0

I did not intend to do a question-and-answer format. But after posting my question above, I tried searching harder in the main stackoverflow. I found a question by Oscar with an answer to my question by Yi Hu. To restate Yi Hu’s answer:

  • go to Project Settings
  • select the executable (“texsyn” in my case)
  • select Build Settings tab
  • search for Architectures
  • change Build Active Architecture Only to be Yes for BOTH Debug and Release

This totally solved my problem. Now builds without error and runs about twice as fast.

Before:

enter image description here

After:

enter image description here

1
  • When I finished typing this in, I saw the answer by mmmmmm in a comment on my original question. Thanks “mmmmmm”! – Craig Reynolds Dec 6 '20 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .