Hello - I’m stumbling through building Seamly2D on a Mac. For some background, it’s been a while since I’ve coded in C++, so I’m totally rusty on the different pieces at play in this build environment. I noticed that the README for the Mac build isn’t completely finished, so I might be in uncharted territory here?
macOS Big Sur 11.2.3
Qt Creator 4.14.2
XCode Command Line Tools 12.4 (contains clang-1184.108.40.206)
Compilers (references above command line tools, from Kits section of Qt Creator):
Seems straightforward? I’m maybe using an Xcode version that contains a newer version of the MacOS SDK (11.1) that Qt might have trouble with. However, even if I downgrade my Xcode tools to something that supports 10.15 SDK, this error still shows up and I get a different error that complains about the clang compiler version. Second question: should I care about this warning? I’ve tried Xcode command line versions 11.7, 12, and 12.4.
When I ignore the above warning and attempt to build Seamly2D anyways, I get the following error (there are multiple, but they are similar to this):
This is where my C++ is rusty. I don’t know what this error is actually saying and googling isn’t helping too much. Also not sure if this issue is a result of not fixing above Issue #1, but I wanted to mention it in case someone recognized this.
Anyways, I’ve been going back and forth between software versions, googling like mad, and figured it was time to throw in the towel and get some help. Thank you in advance.
I wish I could help… I’m not a Mac user. If by chance you are able to get the Mac ver to build let us know what kit settings you used so we can update the Readme.
Well the debugbreak.h file apparently looks like a hack into the debugger of sorts… Are you by chance trying to build in debug mode? I can only assume the compiler is complaining that gnu_inline is not defined as extern. Searching the code gnu_inline I find no definition for gnu_inline… Hmmm could it be a missing include somewhere?
That being said… if you have’t already… check that you’re set to Release and see if that avoids the gnu_inline warnings.
Thanks anyways @Douglas. Even if you’re unable to help with Mac stuff, it’s still nice to know my message isn’t going into a black hole.
Good news - I was able to get past Issue #1. In case this is helpful in the future:
I referenced the Qt mac docs from the Seamly2D README again, double-checked the supported XCode versions (11 and 12 at the time of writing for Qt version 5.15.2).
Downloaded version 12 (again) of the XCode command line tools from Sign In - Apple that should have support for SDK 10.15.
Double-checked the SDK version that comes with the command line tools by running ls -la /Library/Developer/CommandLineTools/SDKs. You should see a reference to SDK 10.15 and a symlink to it. You could run xcrun -sdk macosx --show-sdk-path, but I found it just returned the generic symlink name without a SDK version number.
Closed and opened Qt Creator again. Noticed that error from above still persisted with the exact same info. Started thinking that there must be some sticky reference somewhere to the 11.1 SDK. Cleaned the build, restarted Qt - did nothing. Finally, I deleted the build folders entirely (located next to the Seamly2D git repo).
Restarted Qt and voila - no issues regarding SDK versions are reported when I open the Seamly2D project.
Is deleting the build folder a normal procedure for weird issues in a C++/Qt environment? I’m not 100% sure what the culprit was, but this worked for me.
I was, so I changed it to release mode as you mentioned, but it didn’t resolve the gnu_inline warnings. Do you get any warnings at all when building on your platform?
The behaviour of the gnu_inline attribute now matches GCC, for cases
where used without the extern keyword. As this is a change compared to
how it behaved in previous Clang versions, a warning is emitted for this
After ~1900 warnings (is this normal??), Seamly2D is building on my system. Yay! There’s a mix of deprecated declarations, gnu_inline, and macOS version linking warnings that I probably shouldn’t ignore, but I’ll poke through them when I have more time.
No… although generally running qmake / cmake to clean the build is usually sufficient. What can happen is a reference discrepancy when linking, where either a linked dll is the wrong version, or when making updates, some .o files may not have needed recompiling as far as the make goes, but do need to be updated for a reference. Sometimes you can figure out what files to delete… the mocs, .o’s and make files from an error message… sometimes it’s easier to just delete the whole thing and start clean. Or more often I will just end up deleting a specific lib dir where the issue is, and just let it rebuild that dir. I just wish the warning / error messages were more descriptive as they tend to be rather generic where there could be a dozen reasons for the actual error.
I get plenty… mostly deprecation warnings, as I’m using 5.15.2, but the project is using 5.13.2 on Github. Some of the code is still 5.9 compliant. If I do a clean build, I’ll get 250+ warnings. I’ve been updating a few of the 5.13.2 deprecation warnings as I encounter them, but I should just do a clean build and go through the build log and fix all the warnings to be at least 5.13 compliant and submit a PR.
You can turn off most of the compiler warnings, I just haven’t bothered.
I submitted a PR to update the README with better macos devenv instructions!
I was trying to be clever and download the barebones command line tools in order to avoid downloading giant XCode, but it turns out that QTCreator uses some xcode-specific commands that help it find certain utilities that you can’t do with the command line tools alone. So future macos developers: don’t do what I did.