-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error building with gcc using Xcode 11 when including algorithm header #44579
Comments
Here is the output of gist-log:
Here is the output of brew doctor if it helps:
I know, this should be clean but it is mostly just gtest and gbench related stuff. So I think it should not be related to the issue. I see that I remove these and give an update if this should fix things. I also reference #44776 which seems to be the place to gather catalina issues. But note that it seems to be related to Xcode 11 and not catalina per sé. |
The 10.15 SDK headers in Xcode 11 have a bug in them. It was reported to Apple as FB7338312 ( I've added a local patch to the main GCC formula (see #44762) so that it should build fine now. Can you check? (with the latest version, not older versions) |
@fxcoudert Verified the local patch works for me. I had the same problem as OP, where I first saw it on Mojave and then carried through to Catalina. I forced a Thx so much! |
Hi, thanks for the effort. I am wondering if I am doing something wrong. I did verify that I have the current patch as suggested by looking at the gcc formula (brew edit gcc). I did perform a brew reinstall of gcc and also via |
After reinstalling, do you have a file named |
Something similar: |
No, it should have a Can you paste the output of |
Sure. Here it is:
|
@rrahn I think the issue might be because of the mismatch between your Xcode and CLT versions |
@fxcoudert yes!!! Many thanks for the great support. Updating the command line tools and reinstalling gcc from source indeed fixed it for me. Is there any chance this patch can be back ported for gcc@8 and gcc@7? |
Will do it at some point, after reporting it to GCC as well |
This is only an attempt that might work because OpenMVG travis only tasts Xcode < 11 at the present date. Latest Xcode 11 currently has bugs with GCC which prevents for compiling. These are the curent errors with Xcode 11, which will be fixed soon upstream see Homebrew/homebrew-core#44579 [ 0%] Building CXX object dependencies/osi_clp/CoinUtils/src/CMakeFiles/lib_CoinUtils.dir/CoinBuild.cpp.o In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h:110, from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:66, from /usr/local/Cellar/gcc/9.2.0_1/include/c++/9.2.0/cstdlib:75, from /Users/rfabbri/cprg/vxlprg/lemsvpe/openMVG/src/dependencies/osi_clp/CoinUtils/src/CoinBuild.cpp:7: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:34: error: expected initializer before '__OSX_AVAILABLE_STARTING' 443 | int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | ^~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:449:39: error: expected initializer before '__OSX_AVAILABLE_STARTING' 449 | int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
brew install
(orupgrade
,reinstall
) a single, Homebrew/homebrew-core formula (not cask) on macOS? If it's a generalbrew
problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a Linux problem please file this issue at https://github.com/Homebrew/linuxbrew-core/issues/new/choose. If it's abrew cask
problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew gist-logs <formula>
(where<formula>
is the name of the formula that failed) and included the output link?brew gist-logs
didn't work: ranbrew config
andbrew doctor
and included their output with your issue?To help us debug your issue please explain:
I updated my xcode to the newest version Xcode 11 on macos 10.14.6. I reinstalled all my productive gcc's (7, 8, 9). If I try to compile the following snippet:
with the following compiler falgs:
it fails with the following errors.
I would have expected no error, since it seems like messed up include orders.
In fact when including e.g.
string
beforealgorithm
the code compiles just fine:brew install
commands)install latest xcode 11 on macos 10.14 or macos 10.15
optionally upgrade gcc
compile the above code with:
Note the isysroot and macsox-version-min are set by cmake automatically. If one removes these the code compiles as well.
I am also not very sure if this is the right place for this issue or if this should be fixed upstream by apple. Maybe, I am also just getting something completely wrong, but since it depends on the includes of the file I guess something unusal is broken. Any advice or assistance is very appreciated.
The text was updated successfully, but these errors were encountered: