Switching Qt Versions

On one of my Macs, I had been using Qt 5.9.2 for my Owl project. One thing that was driving me nuts was that when I ran Owl, I saw these messages in the Application Output:

2019-02-06 08:10:32.105550-0500 Owl[47342:2167506] libpng warning: iCCP: known incorrect sRGB profile
2019-02-06 08:10:32.107368-0500 Owl[47342:2167506] libpng warning: iCCP: known incorrect sRGB profile
2019-02-06 08:11:02.405359-0500 Owl[47342:2167506] libpng warning: iCCP: known incorrect sRGB profile
... (on and on and on)

I researched this a few weeks ago and remembered reading that newer versions of Qt fixed this. (**NOTE It is very possible (and even likely) that I misrembered!**) It just so happened that I already had a copy of Qt 5.11.2 installed. Great! I reset my CMake cache, cleaned and rebuilt and it compiled right away! 👍 Everything was great until I went to run it.

$> open -n src/Owl.app/
LSOpenURLsWithRole() failed with error -10810 for the file /Users/adalidclaure/src/github/Owl/bin/src/Owl.app.

I’ve seen variations of this error throughout my time with Qt. Usually it’s caused by a bad rpath in the executable. It was one of the first things I checked:

$> otool -L src/Owl.app/Contents/MacOS/Owl
src/Owl.app/Contents/MacOS/Owl:
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.70.7)
	@rpath/QtQuickWidgets.framework/Versions/5/QtQuickWidgets (compatibility version 5.11.0, current version 5.11.2)
	@rpath/QtWebEngine.framework/Versions/5/QtWebEngine (compatibility version 5.11.0, current version 5.11.2)
...

Normally when I see this kind of problem what I’d find is that the entire path of the Qt libraries would be baked into the executable. Obviously that was not the case here.

Long story short, I never figured out exactly what the problem was. Instead, I went to Qt’s website and downloaded the latest release (5.12.1 as of this writing). Using a fresh build directory and everything is working great now!

Except I still see:

2019-02-06 08:10:32.105550-0500 Owl[47342:2167506] libpng warning: iCCP: known incorrect sRGB profile
2019-02-06 08:10:32.107368-0500 Owl[47342:2167506] libpng warning: iCCP: known incorrect sRGB profile
2019-02-06 08:11:02.405359-0500 Owl[47342:2167506] libpng warning: iCCP: known incorrect sRGB profile
... (on and on and on)

/sigh